I am having trouble with getting a date format into MM/DD/YYYY format after I have done an AYMD on it. See the following code. The &DATELIM field calculates the correct date, now I want this field to convert to a different format to display in the header of a report. The &DAYS is a variable day value that the user will input.
Thanks
-SET &DATELIM=AYMD(&YYMD,&DAYS*-1,'YYMD');
DEFINE FILE CAR
ToLimit/YYMD=&YYMD;
FromLimit/MDYY=DATECVT(&DATELIM, 'YYMD', 'MDYY');
END
TABLE FILE CAR
-*ON TABLE NOTOTAL
SUM
CAR.BODY.RETAIL_COST
BY CAR.ORIGIN.COUNTRY
BY ToLimit
BY FromLimit
END
This message has been edited. Last edited by: Trudy,
WF8 Windows
November 21, 2017, 03:06 PM
Waz
Why not just use the Smart Date to subtract the days.
DEFINE FILE CAR
ToLimit/YYMD=&YYMD;
FromLimit/MDYY=ToLimit - &DAYS;
END
TABLE FILE CAR
-*ON TABLE NOTOTAL
SUM
CAR.BODY.RETAIL_COST
BY CAR.ORIGIN.COUNTRY
BY ToLimit
BY FromLimit
END