Hello,
Trying to get the date of the most recent Sunday that has past (or if it is Sunday use that date). Deriving this date in a user variable stage.
Would like the output format of the date to be YYYYMMDD.
thanks!
Get Date
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try this.
The internal format of the date is an integer. Assuming your system is set up with Sunday = 0, the first argument of the Oconv() function above will give the date of the most recent Sunday.
If your system is set up with a different day as the first of the week, simply adjust the arithmetic to suit.
Code: Select all
Oconv(Date() - Mod(Date(),7), "DYMD[4,2,2]" : @VM : "MCN")
If your system is set up with a different day as the first of the week, simply adjust the arithmetic to suit.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.