Page 1 of 1

How to calcdate in formato MMDDYYYY

Posted: 16 Apr 2012 8:43
by th_alejandro
How can I obtain a MMDDYYYY var format using calcdate ?

for example, today is 20120416 and i use a CALCDATE to return the last day of the previous month as PARM1 %%$CALCDATE %%$DATE - %%$DAY, CTM returns 20120331, but i need this date in format MMDDYYYY. Any idea ?

Currently, i must take this date and convert in the script code from YYYYMMDD to MMDDYYYY, but i think it's very nice if this variable pass as needed.

Thanks. 8O

CALCDATE IN FORMAT MMDDYYYY

Posted: 17 Apr 2012 5:03
by brownbag
You need to do the following
%%YYYY = %%SUBSTR %%YYYYMMDD_DATE 1 4
%%MM = %%SUBSTR %%YYYYMMDD_DATE 5 2
%%DD = %%SUBSTR %%YYYYMMDD_DATE 7 2
%%PARM1 = %%DD.%%MM.%%YYYY