[thelist] CF: MySQL Matching date/time values with date type?

Steve Lewis nepolon at worlddomination.net
Sat Feb 7 13:09:41 CST 2004


Frank wrote:

> SELECT

> FROM order_log l

> WHERE date_order_placed = #CreateODBCDate(search_date)#

Add 1 to the search-date and include it as a second condition to the search:

SELECT my_cols
FROM my_tables
WHERE date_order_place >= #CreateODBCDate(search_date)# AND 
date_order_place < #CreateODBCDate(DateAdd('d',1,search_date))#

If using MS SQL you can use the BETWEEN syntax:

SELECT my_cols
FROM my_tables
WHERE date_order_place BETWEEN #CreateODBCDate(search_date)# AND 
#CreateODBCDate(DateAdd('d',1,search_date))#

hth
Steve


More information about the thelist mailing list