[CLOSED] DateTime field format manipulation needed *ddh*
How do I convert (i.e. functions to use) the following Datetime field formats 2011/09/07 11:48:22.000 TO 09/07/2011 11:48:22 AM. It seems to reason there has to be a easy way to do this?? Any assistance is GREATLY APPRECIATED. I'm using WebFocus version 7.1.4 currently.This message has been edited. Last edited by: Kerry,
September 12, 2011, 05:14 PM
Tomsweb
quote:
How do I convert (i.e. functions to use) the following Datetime field formats 2011/09/07 11:48:22.000
Thanks for all your replies but unfortunately none of these worked. First, our version of Webfocus is 7.1.4 and it didn't recognize the function HMDYYIA or HHIA. I can get the date portion to the format I want but when I try putting it all together with the time (minus the micro seconds 000) it doesn't work. It's important to get the AM or PM depending on the time of the day. The master file defines this field as partcular field as HYYMDs. Unfortunately, our environment is so locked down I'm unable to change this format. Thanks again for all those that replied.
September 12, 2011, 11:47 PM
Waz
What did you try ?
All you should have to do is a DEFINE or COMPUTE e.g.
Thanks for the recent reply WAZ. I tried just redefining the field and my results are close but I still can't get the "AM" or "PM" at the end of the date. Instead it's giving me 24hour time. I could write code to evaluate the time and manually adjust but I wouldn't think that would be necessary. Again, thanks so much for responding to my scream for help. Have a great day.
September 13, 2011, 09:02 AM
jfr99
Hi,
Here's an example using CAR.
-* DEFINE FILE CAR CNT/I3 WITH COUNTRY = CNT + 1; A_DTS/A14 = DECODE CNT ( 1 '20110907114822' 2 '20110907120505' ELSE '???'); END -* TABLE FILE CAR PRINT CNT A_DTS WHERE RECORDLIMIT EQ 2 ON TABLE HOLD END -* DEFINE FILE HOLD SD_DTS/HYYMDS = HINPUT(14, A_DTS, 8, 'HYYMDS'); -* SD_DTS1/HYYMDs = SD_DTS; SD_DTS2/HMDYYSA = SD_DTS; END -* TABLE FILE HOLD PRINT CNT A_DT SD_DTS SD_DTS1 SD_DTS2 END