ODBC MS Query - comparing dates

  • Thread starter Thread starter JoeF
  • Start date Start date
J

JoeF

Having trouble with SQL statement

table= loans
field_name=pay_date

I want to say WHERE loans.pay_date < TODAY I tried today(), sysdate,
CurrentDate nothing seems to work. Any help is appreciated.

Joe
 
What database?
In Firebird and Interbase for example you can do:
WHERE loans.pay_date < 'TODAY'

RBS
 
Superbase. In Superbase I can use TODAY and it works fine. Problem is when I
insert SQL statement in MS Query I get various errors.
I tried yours and got the following error msg "Ivalid operand for operator:
<" Other messages include - "Expected Lexical element not found..", "Column
not found..." etc...

Thanks.
 
I don't know Superbase, but maybe you can do this:

WHERE loans.pay_date < (select TODAY from loans)

The other option is to use a variable and put the current date in that in
the right format, so you will get something like this:

"SELECT * FROM loans WHERE loans.pay_date < " & strCurrentDate


RBS
 
Back
Top