Focal Point
[SOLVED] Date Format DD-MON-YEAR

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

May 02, 2018, 12:23 PM
Terri1977
[SOLVED] Date Format DD-MON-YEAR
Hello,
How can I change a date format from 20180629 to 29-JUN-2018?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
May 02, 2018, 01:12 PM
Tom Flynn
Terri1977,
You can probably replace TEMPX with your Date Column in the FPRINT function; I did the TEMPX to test the code:

COMPUTE TEMPX/YYMD='20180629';
COMPUTE DATE_01/A20= EDIT(FPRINT(TEMPX,'DMTYY','A20'),'99-$999$-$9999');

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 02, 2018, 05:10 PM
Waz
Where does the date come from ?

Is it a DB field ?
If so, what is the format of the field ?


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!

May 04, 2018, 01:07 PM
Terri1977
It is a DB field, the field is called SSRMEET_START_DATE and the format is HYYMDS


WebFOCUS 8
Windows, All Outputs
May 04, 2018, 01:17 PM
Tom Flynn
This is BANNER, convert with HDATE 1st...

COMPUTE TEMPX/YYMD = HDATE(SSRMEET_START_DATE, 'YYMD');

COMPUTE DATE_01/A20= EDIT(FPRINT(TEMPX,'DMTYY','A20'),'99-$999$-$9999');

Easey-Peasey...

EDIT: Added COMPUTE for TEMPX / Can be a DEFINE as well...

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 04, 2018, 01:53 PM
jfr99
Another way that gives you the leading zero on the Day portion ...

DTS/HYYMDS = SSRMEET_START_DATE;
NEW_DTE/A11 = HNAME(DTS,'DAY','A2')|'-'|HNAME(DTS,'MONTH','A3')|'-'|HNAME(DTS,'YEAR','A4');


WebFocus 8.201M, Windows, App Studio
May 04, 2018, 02:37 PM
Tom Flynn
Sweet!!! Nice, jfr99....


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 10, 2018, 10:12 AM
Terri1977
Thank you.


WebFOCUS 8
Windows, All Outputs