Focal Point
[SOLVED]Change Date format

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

December 23, 2014, 07:43 AM
info4pal
[SOLVED]Change Date format
Hi,

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,


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
December 23, 2014, 10:32 AM
Shakila Subhan
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 :

TABLE FILE SQLOUT
PRINT *
COMPUTE MYDATE/HYYMDS = HINPUT(20,'&DATEPARAM',10,'HYYMDS');
END
-RUN

But for that column,Iam getting as blank output without any data.
Is there any other work around for this.Please let me know.

Thanks a lot in advance!

Regards!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
December 24, 2014, 01:50 AM
info4pal
Hi,

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');

Thanks a ton both of you!

Regards!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML