As an alternative to changing your job date....
you could convert the date in the file from Julian to a date...
CHKDATE date(substr(
digits(YourJulianDate+1900
Calculate your comparison date based on CURRENT(DATE) adjusted by year, month and day
CMPDATE CURRENT(DATE) - 2 month +2 day
- 1 year
and then select records based on the comparison between CHKDATE and CMPDATE eg.
CHKDATE LT CMPDATE
or
CHKDATE GE CMPDATE
This way, if you print dates, they are in a format which is more user friendly....
hint : include the CMPDATE field in your selected fields so that you have an audit of what date was being used in the selection.
Tony.
Main Topics
Browse All Topics





by: _b_hPosted on 2006-05-26 at 19:16:07ID: 16773845
If you are looking for a simple way,
1) change your job date format to julian using CHGJOB DATFMT(*JUL)
Now CURRENT(DATE) will return the current date in julian format
2) define the result fields in your query, one to retrieve the current date:
YYDDDDATE current(date)
and one to subtract an amount of years/months/days
PREVDATE YYDDDDATE - 3 years - 2 months - 1 days
where PREVDATE will be in julian format
3) select the records by comparing to the date YOURDATE in the file:
YOURDATE LT PREVDATE
4) change your job date back to the default date format
The query output for today looks like:
YYDDDDATE PREVDATE
06/146 03/084
Post back any questions!
Barry