kbmMemSQL filter using date

Home Forums kbmMemTable kbmMemSQL filter using date

Tagged: 

Viewing 2 reply threads
  • Author
    Posts
    • #57072
      moctes
      Participant

      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

    • #57073
      moctes
      Participant

      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

    • #57106
      kimbomadsen
      Keymaster

      Hi,

      You can use SQL function DATE(col). It will essentially do the same (use trunk)

      /Kim

Viewing 2 reply threads
  • You must be logged in to reply to this topic.