To retain a timestamp value, two possible options come to mind:
1) Use the TimestampFromSecondsSince(). You'll need to calculate the number of seconds that equate to three months (there are 86400 seconds in a day)
2) Get date and time separately--CurrentDate() and CurrentTime(). Then use DateFromDaysSince() to calculate the date 3 months previous to CurrentDate() and create a timestamp from the resulting date and CurrentTime() value.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
Ultimately the requirement depends upon the actual business rules (i.e. the client's requirements) for the calculation. They may simply state 90 days previous. Many accounts receivables calculations are based upon 30, 45, 60 and 90 days and not necessarily number of days in the month (although adjustment may be made from time to time).
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
Create a routine that subtracts 3 from the month if it is 4 through 12, or adds 9 to the month and subtracts 1 from the year if the month is 1 through 3, then adjusts the date backwards until it is valid. From that new date, rebuild the timestamp.
Alternately you could perform these steps in stage variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.