Board index » delphi » SQL Date query via ODBC Access driver

SQL Date query via ODBC Access driver

Can anyone tell me what's wrong with the following query?

SELECT *
FROM
 Members
WHERE
 Members."Date Expires" > 5/1/97

When I run this query, I get a all fields back including those that
don't satisfy the conditional stated in the query. I'm running on a MS
Access 1.1 Database using the ODBC 11/94, D1, and BDE 2.52. The "Date
Expires" field is a date field.

TIA

JC

 

Re:SQL Date query via ODBC Access driver


Quote
Jonathan Crockett wrote:

> Can anyone tell me what's wrong with the following query?

> SELECT *
> FROM
>  Members
> WHERE
>  Members."Date Expires" > 5/1/97

> When I run this query, I get a all fields back including those that
> don't satisfy the conditional stated in the query. I'm running on a MS
> Access 1.1 Database using the ODBC 11/94, D1, and BDE 2.52. The "Date
> Expires" field is a date field.

> TIA

> JC

Use the ODBC data function. It works with Oracle, Access, and everything
else that uses ODBC connections:

select * from t."the table" where t."date_field" > {d'1997-05-01'}

Peter

Other Threads