Hi,
I have a tsqlquery with an insert statement. One of the fields is a timestamp. I use parameters to set field values, and for the timestamp field the statement is:
q.ParamByName('DATE_FIELD').AsDateTime := Now
When I execute the statement with ExecSQL i get a "No value for parameter DATE_FIELD.
It used to work with UIB Dbexpress driver I was using with D2006. Any clue? I even tried using .Value instead of .AsDateTime
TIA,
Fabio Dalle Ave
D2007 and firebird Datatime parameter error
You should use the following code for Delphi 2007:
Code: Select all
SQLQuery.ParamByName('DATE_FIELD').DataType := ftTimeStamp;
SQLQuery.ParamByName('DATE_FIELD').Value := Now;
Thanks.Plash wrote:You should use the following code for Delphi 2007:Code: Select all
SQLQuery.ParamByName('DATE_FIELD').DataType := ftTimeStamp; SQLQuery.ParamByName('DATE_FIELD').Value := Now;
I tried that but didn't work. Same error.
Fabio