TADOQuery and Date fields problem



Hi All,

I am using a TADOQuery in order to search through a table of records for a
date value. I can't seem to get the syntax right when specifying the SQL
statement though. I have the following:

qryLookUp.SQL.Add('SELECT * FROM table1 WHERE ((DevID = '+
IntToStr(intDevID) + ') and (ServiceDateTime = #' + serviceDate + '#'
+'))');

serviceDate above is a string containing the date and time I am looking for.
ServiceDateTime DateTime field in MS Access.

I get an error that says 'Parameter object is improperly defined'. Does
anyone know the syntax for doing a search for a date value?

Any help would be appreciated.

Thanks.
Shannon


.



Relevant Pages

  • Re: TADOQuery and Date fields problem
    ... >I am using a TADOQuery in order to search through a table of records for a ... I can't seem to get the syntax right when specifying the SQL ... >ServiceDateTime DateTime field in MS Access. ... Use a parameter in your query for the dateTimeValue ...
    (borland.public.delphi.database.ado)
  • Re: Full-Text searching
    ... If I use the TADOQuery to do a full-text on a file system, ... Liz the Brit ...
    (borland.public.delphi.non-technical)