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.
How to calcdate in formato MMDDYYYY
- th_alejandro
- Nouveau
- Posts: 188
- Joined: 26 Nov 2008 12:00
- Location: Bogotá
CALCDATE IN FORMAT MMDDYYYY
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
%%YYYY = %%SUBSTR %%YYYYMMDD_DATE 1 4
%%MM = %%SUBSTR %%YYYYMMDD_DATE 5 2
%%DD = %%SUBSTR %%YYYYMMDD_DATE 7 2
%%PARM1 = %%DD.%%MM.%%YYYY