In a delphi program I use date parameters in a query.
Like this:
mq.SQL.Text := 'SELECT * FROM TABLE WHERE A_DATE >= :P_DATE';
mq.Prepare;
mq.ParamByName('P_DATE').Value := DateOf(Some_Date);
mq.Open;
This used to work fine, but after upgrading to SDAC 3.80 this doesn't work
anymore.
I already worked around it by using literal date values, but I still would like a comment on this, because I have more projects that will certainly be affected by this problem.
Peet Terluin
Date parameters in query don't work with 3.80.0.36
You should specify parameters data type before calling the Prepare method.
For example:
For example:
Code: Select all
mq.SQL.Text := 'SELECT * FROM TABLE WHERE A_DATE >= :P_DATE';
mq.ParamByName('P_DATE').DataType := ftDateTime;
mq.Prepare;