Greg
Greg

Reputation: 31

Call mysql through odbc and excel

I am calling a query through an odbc connection from excel.

I have a where clause where I want to use dates.

This works for a date sale.saledate>={d '2012-10-29'}

But I need to add time in also

I tried sale.saledate>={d '2012-10-29 3:30 PM'}

But this does not work.

any ideas?

Upvotes: 0

Views: 194

Answers (1)

bohica
bohica

Reputation: 5992

Try {ts '2012-10-29 15:30:00'}. Search for ODBC date time formats. ODBC has its own syntax for dates, times and timestamps which the driver is supposed to translate to the database.

Upvotes: 2

Related Questions