Reputation: 11393
I want to put the following condition in my query ,but i don't know the correct syntax in informix to do that .
At least one year passed on his work date ..
So
I try some thing like that
b.work_date - CURRENT >= 12 -- 12 month
How to do that ?
Upvotes: 0
Views: 136
Reputation: 9188
You need to be careful with the CURRENT - 12 UNITS MONTH
approach. It does not take the leap-day in February into account, and would explode with an Invalid day in date
error if you ran it on 2012-04-29.
It is safer to write
b.work_date < TODAY - 365
Upvotes: 1