×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Don,
DB2 supports date arithmetic so something like CURDATE() - 30 DAYS ought to
work in your case.
Fact that you're using CURDATE built-in versus CURRENT_DATE special register
saves you from cross-midnight considerations as DB2 reads time-of-day clock
once per statement execution, which is exactly what you want.
Elvis
Celebrating 10-Years of SQL Performance Excellence on IBM i5/OS and OS/400
http://centerfieldtechnology.com/training.asp
-----Original Message-----
Subject: RE: SQL Date Math
Jim,
I'm liking method 2, and got it to work. Thanks! Now, how would I go
about adjusting the curdate - say to subtract 30 days from it before
using it in the comparison?
Don
-----Original Message-----
Subject: Re: SQL Date Math
Ok - hit send to early!
2nd way;
When Dec( digits(Dec(year(curdate()),4,0)) ||
digits(Dec(month(curdate()),2,0)) ||
digits(Dec(day(curdate()),2,0)) ) = refdta
This extracts the year, month and day from current date, then puts them
back together and makes it into a number to compare with the field
refdta.
HTH
Jim
As an Amazon Associate we earn from qualifying purchases.