How to compare a datetime field with a date

Quote
"nieurig" <nieu...@yahoo.de> wrote in message

news:3dfccb08@newsgroups.borland.com...

Quote
> 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
anywhere.

--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
"The only reason some people get lost in thought is because it's unfamiliar
territory." - Paul Fix