Focal Point
[SOLVED] convert date format from dd/mm/yy to dd-mon-yy

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

July 09, 2020, 11:25 AM
WF_Noob
[SOLVED] convert date format from dd/mm/yy to dd-mon-yy
I have a date input in Webfocus html form. The form is writing into the DB by a SQL Passthrough. The oracle default date format is DD-MON-YY (01-JAN-01). Webfocus offers a lot of date formats within the tool except the one required for me.

How do I convert from DD/MM/YY to DD-MON-YY.


Thanks

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


8206
July 09, 2020, 01:26 PM
FP Mod Chuck
WF_Noob

Here is a sample against ggsales which is YYYMD but you can see the syntax to convert...

DEFINE FILE GGSALES
ALPHA_MO/A3=
IF EDIT(DATE,'$$$$99') EQ '01' THEN 'JAN' ELSE
IF EDIT(DATE,'$$$$99') EQ '02' THEN 'FEB' ELSE
IF EDIT(DATE,'$$$$99') EQ '03' THEN 'MAR' ELSE
IF EDIT(DATE,'$$$$99') EQ '04' THEN 'APR' ELSE
IF EDIT(DATE,'$$$$99') EQ '05' THEN 'MAY' ELSE
IF EDIT(DATE,'$$$$99') EQ '06' THEN 'JUN' ELSE
IF EDIT(DATE,'$$$$99') EQ '07' THEN 'JUL' ELSE
IF EDIT(DATE,'$$$$99') EQ '08' THEN 'AUG' ELSE
IF EDIT(DATE,'$$$$99') EQ '09' THEN 'SEP' ELSE
IF EDIT(DATE,'$$$$99') EQ '10' THEN 'OCT' ELSE
IF EDIT(DATE,'$$$$99') EQ '11' THEN 'NOV' ELSE 'DEC';
ORACLE_DATE/A9=EDIT(DATE,'$$$$$$99') | '-' | ALPHA_MO | '-' | EDIT(DATE,'$$99');
END
TABLE FILE GGSALES
BY ORACLE_DATE
WHERE READLIMIT EQ 10
WHERE RECORDLIMIT EQ 10
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,
$
ENDSTYLE
END



Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 09, 2020, 01:30 PM
MartinY
You will have to play around with the format because I don't know how your field are stored (displayed format is one thing, storage another), but this is a starting point
DEFINE FILE CAR
DTX /I8 = 20200705;
DT  /A8DMYY = DATECVT(DTX, 'I8YYMD', 'A8DMYY');
-* The T is to display the 3 characters month in capitals letters (t = mixed case, TR = full month name capital, tr = full month name mixed case)
DTA /D-M-YYT = DT;
END
TABLE FILE CAR
PRINT DTX
      DT
      DTA
BY COUNTRY
WHERE READLIMIT EQ 1;
END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
July 10, 2020, 11:10 AM
Tony A
Gents,

Might I suggest that you're trying too hard Razzer

TABLE FILE GGSALES
SUM FST.DATE/D-Mt-YY
BY DATE
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 10, 2020, 11:14 AM
FP Mod Chuck
Tony

You are absolutely right... Thanks!


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats