Page 1 of 1

SQLDataSet Params AsDateTime don't work

Posted: Tue 25 Nov 2008 09:43
by ale.capu
Hello,
I've try to execute a query with a datetime parameter like this:

SQLDataSet.CommandText := "SELECT * FROM test WHERE ins_date>=:par_date"
SQLDataSet.Params['par_date'].AsDateTime := Now();
SQLDataSet.Open;

This raise an exception with "par_date param not found". If I try another param type (for example AsTimeStamp) it works fine.

Posted: Tue 25 Nov 2008 15:22
by Dimon
I could not reproduce the problem.
Please supply me the version of DbxMda that you use, and version of your IDE.

Try to use the following code:
SQLDataSet.Params.ParamByName('par_date').AsDateTime := Now();
instead of
SQLDataSet.Params['par_date'].AsDateTime := Now();