iSeries query to pull records by date
Posted on 2012-04-12
I have a query I am trying to get to run in JDE. I am trying to get a listing of all work orders which have been closed in the past 5 days.
Everything works until I try to get a date qualifier in there (WASTRX is our 'date closed' field).
Here is my query. I'm comfortable with SQL, just not iSeries....
LEFT OUTER JOIN E1PRODDTA/F4211 ON
STRIP(F4801.WARORN, LEADING, '0' ) = STRIP( DIGITS( F4211.SDDOCO), LEADING, '0' )
AND F4801.WALNID = FLOOR( F4211.SDLNID )
WASRST > '93'
AND WAUORG = WASOQS
AND WARORN<> ' '
AND WASTRX < CURDATE() - 5 DAYS
I WASTRX is stored as a 'normal' date (mm/dd/yyy). I am assuming that CURDATE() is in Julian format. I'm thinking I need to format one to match the other prior to comparison, but I'm not sure how to do that.
Thanks for any help you can provide!