I need to change the format of the date-time date field. e.g.2008/05/27 4:07:11 to 05/27/2008 4:07:11PM The orginal field format is (HYYMDS) and I need to change it to MM/DD/YYYY HH:MM:SS(AM/PM).
Could anyone please help me on this!
Regards! Thanks.This message has been edited. Last edited by: info4pal,
DEFINE FILE CAR
MYDATE/HYYMDS WITH COUNTRY = HINPUT(20,'2014/12/22 13:35:01',10,'HYYMDS');
MYDATE1/HYYMDSA WITH COUNTRY = MYDATE;
END
TABLE FILE CAR
PRINT COUNTRY MYDATE MYDATE1
END
WebFOCUS 8.0.08 - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5 Windows, All Outputs
December 23, 2014, 11:38 AM
MartinY
Shakila code must be changed a little bit to have MMDDYY instead :
DEFINE FILE CAR
MYDATE/HYYMDS WITH COUNTRY = HINPUT(20,'2014/12/22 13:35:01',10,'HYYMDS');
MYDATE1/HMDYYSA WITH COUNTRY = MYDATE;
END
TABLE FILE CAR
PRINT COUNTRY MYDATE MYDATE1
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
December 24, 2014, 01:14 AM
info4pal
Hi,
Thanks Shakila and Martin for the quick response and solution. But Iam actually trying to pass my date as an amper variable inside my TABLE FILE SQLOUT and I tried passing it in this way :
I got the solution. I used this format first: COMPUTE ALPHA_DATE/A20 = HCNVRT(DATEPARAM, '(H17)', 17, 'A20'); COMPUTE MYDATE/HYYMDS = HINPUT(20, ALPHA_DATE, 10,'HYYMDS');