Focal Point
[CLOSED]Converting DateTime field To just MM/YYYY

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

August 18, 2016, 11:24 AM
Denny99
[CLOSED]Converting DateTime field To just MM/YYYY
I tried using HDate to get my DateTime to only MDYY and then used the EDIT function to manipulate the date to MM/YYYY with no success.
Any further guidance is greatly appreciated.

This message has been edited. Last edited by: <Emily McAllister>,
August 18, 2016, 11:32 AM
Tony A
Look at the datetime functions in this link

In particular you might want to consider HDATE and then pop the result in a field with MYY format.

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 
August 18, 2016, 12:19 PM
BabakNYC
You could use HPART(datetime, 'component', output) to get the specific parts of the datetime field like Month, Year Day, et cetera.


WebFOCUS 8206, Unix, Windows
August 19, 2016, 12:50 PM
George Patton
You could still use EDIT, but you'll have to use it twice: Once to convert from numeric to alpha and then again with a mask to extract the date.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
August 22, 2016, 08:46 AM
jgelona
If this is a field a sql database, try adding a row to the master that defines the field as a date instead of a datetime field. I do it all the time.
  FIELD=AS_BEGDTTM  , STRT_DT           , HYYMDS, HYYMDS            ,$
  FIELD=AS_BEGDT    , STRT_DT           , YYMD  , DATE              ,$


then print AS_BEGDT like this:
 PRINT AS_BEGDT/MYY



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.