December 10, 2010, 09:13 AM
Ted Michalski[RESOLVED] More fun with Dates
I can get the date format Oct-2010 if I use the following code:
COMPUTE DT1/DMY = HDATE(DB_DATE_FIELD, 'DMYY');
COMPUTE DT2/MYY = DT1 ;
COMPUTE DT3/A10 = DATETRAN(DT2,'(MYY)','(-dt)','EN',10,'A10');
But I need October-2010.
If I change the code to
COMPUTE DT3/A13 = DATETRAN(DT2,'(MTrYY)','(-dt)','EN',13,'A13');
I get blanks for DT3. Any ideas why?
This message has been edited. Last edited by: Ted Michalski, December 10, 2010, 10:02 AM
Dan SatchellTry this instead. Output formatting is being done by the third parameter, not the second.
COMPUTE DT3/A10 = DATETRAN(DT2,'(MYY)','(-dtr)','EN',15,'A15');
December 10, 2010, 10:10 AM
Ted MichalskiTHANKS! That works.