All Forums UDA
karver 17 posts Joined 01/09
25 Feb 2009
extract date value in format YYYYMMDDHHMMSS

Hi,This probably might be an easy thing to do, however I'm still not that much of an expert at this, so I would like to ask your help. I have a field of type date in one column of a table and I want to select that field, but the format must be, 14 characters - YYYYMMDDHHMMSS (e.g. 20090215142931)I have tried:select field (format 'YYYYMMDDHHMMSS') (CHAR(14))and select field (format 'YYYYMMDDHHMISS') (CHAR(14))But did not get the data successfully. Should I be using cast? or Is the format I'm using wrong?Please advise. Thanks!

Adeel Chaudhry 773 posts Joined 04/08
25 Feb 2009

Hello,Try by casting it to TIMESTAMP(0).Regards,Adeel

-- If you are stuck at something .... consider it an opportunity to think anew.

karver 17 posts Joined 01/09
27 Feb 2009

that worked! thanks a lot! :)

You must sign in to leave a comment.