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>, September 06, 2016 10:38 AM 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
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.
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.
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