beechers
asked on
How to do date arithmetic to return a date as in "select ... from ... where date_field >= [today's date] - 5"
I need to do a query against a Firebird database and haven't seen my exact example. I want to, in a query, do, "select ... from... where date_field >= [today's date] - 5". I saw "current_date" in another posting, but I had thought I had to use, "get_date()" to retrieve the system date? Appreciate any help. Susan
are you working in dialect 1 or 3
SELECT *
FROM orders
WHERE date_field >= ’TODAY’ - 5
FROM orders
WHERE date_field >= ’TODAY’ - 5
kacor's solution will work in dialect 1, dialect 3 will require
select * from employee where finishdate < current_timestamp - 5
select * from employee where finishdate < current_timestamp - 5
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to all for your help!