How to compare a datetime field with a date

"nieurig" <> wrote in message

> i like to compare a datetime field at the database with a "Date-String". I
> generate the following Select statement:

> SELECT F1,F2 FROM TAB1 WHERE (DBDate = #2/2/2002#) ORDER BY F1

> Executing this query i got the following runtime error.
> "... EDBEngineError ...  Wrong keyword: Symbol String #2/2/2002#,
> Linenumber: 1 ..."

Using # to delimit a date is an Access-only feature. The SQL standard for
dates is simply single quotes and the date must be in a format acceptable by
the particular database you are using. 'MM/DD/YYYY' works pretty much

Wayne Niddery - Logic Fundamentals, Inc. (
"The only reason some people get lost in thought is because it's unfamiliar
territory." - Paul Fix