Focal Point
[SOLVED]Date Formatting issue

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5267093886

November 21, 2017, 02:45 PM
Trudy
[SOLVED]Date Formatting issue
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



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

November 21, 2017, 03:43 PM
Trudy
Thanks Waz, worked great.


WF8
Windows