Focal Point
[SOLVED] Date Format DD-MON-YEAR
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 , May 08, 2018 10:38 AM 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 , May 02, 2018 04:20 PM 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.04 Upgrade: WebFOCUS 8.2.07 OS: Linux Outputs: 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 , May 04, 2018 01:54 PM 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