- This topic has 2 replies, 2 voices, and was last updated 2 years, 8 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › kbmMemTable › kbmMemSQL filter using date
Tagged: kbmMemSQL
Hi,
I couldn’t find a sample of ExecSQL, using a datetime field on the WHERE clause, I’m looking for something like this:
consMT.ExecSQL(‘select myDateField, myTextField from gastos where myDateField >= ‘);
On a Query component I would use parameters and then Params[0].AsDateTime := etc
How can I use dates on the Where clause?
With regards.
Mocte
After posting this I remembered that the Date(Time) type is a number, so for now I solved it like this:
QueryMT.ExecSQL( Format(‘select * from expenses where myDateField >= %d’, [trunc(myDate)]) );
Still if there is a better way to do it tips are welcome
Hi,
You can use SQL function DATE(col). It will essentially do the same (use trunk)
/Kim