> The most reliable technique is to pass in the date as a
> parameter of type .AsDate or .AsDateTime
This is how some of the code is handled at present, however TQuery's have
.ParamByName and TADOQuery has .Parameters.ParamByName so I've got code
like:
{$IFDEF USE_ADO}
Parameters.ParamByName('TableName').Value := UpperCase(Table);
Parameters.ParamByName('GraphField').Value := UpperCase(GraphField);
{$ELSE}
ParamByName('TableName').AsString := UpperCase(Table);
ParamByName('GraphField').AsSTring := UpperCase(GraphField);
{$ENDIF}
But I also often make use of a small function I have like:
with SQLResultFmt('SELECT * FROM thetable WHERE id_name =
''%s''',[sIdName]) do
begin
....
end;
Sometimes these have dates in them. However, I also have a function
SQLDate() that returns a TDateTime formatted for SQL, which I'll modify to
wrap #'s for Access.
Mark
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz