Page 1 of 1

Get Date

Posted: Tue Mar 15, 2016 1:32 pm
by cyclogenisis
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!

Posted: Tue Mar 15, 2016 2:52 pm
by qt_ky
Try using the PreviousWeekdayFromDate() function. Let us know what you try and if you get stuck.

Posted: Tue Mar 15, 2016 2:52 pm
by ray.wurlod
Try this.

Code: Select all

Oconv(Date() - Mod(Date(),7), "DYMD[4,2,2]" : @VM : "MCN")
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.

Posted: Tue Mar 15, 2016 2:53 pm
by qt_ky
Try using the PreviousWeekdayFromDate() function. Let us know what you try and if you get stuck.

Posted: Tue Mar 15, 2016 2:53 pm
by qt_ky
Ah, I saw the "parallel" type and missed the user variables stage part.

Posted: Wed Mar 16, 2016 5:28 pm
by cyclogenisis
thanks ray