Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPGIII Date Conversion 1

Status
Not open for further replies.

glowz

Programmer
Mar 19, 2007
2
US
Hello! I have an RPGIII question: Say you want to run a report for a number of days in the past from today (example, you want to show all orders with dates 15 days prior to today's date - so you would show all orders from 3/04/07 through 3/18/07).
I vaguely remember a command or routine to do this? The input date is in ccyymmdd format: 20070304 and the output date should be in the same format.
Thank you so very much!
 
Short answer: convert the program to RPG IV and use the built-in date functions. It's really awkward (not to mention ineffecient) to do date calculations in RPG III.

If you can't convert the whole program, the easiest way is to call an RPG 4 routine to do the date math. Have a look here.

Tibi gratias agimus quod nihil fumas.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top