In our database we have a system-generated ID that is built off of the timestamp. It’s not a date or time format, it’s a string, like (20130405103422), which is essentially the year, month, day, hour, minute and second that the record was created. I want to join it to another field, which is date, but I need to convert it first. How do I do that
Try using the below query,
cast(cast('20130405233422' as timestamp(0) format 'YYYYMMDDHHMISS') as date format 'YYYY-MM-DD')
please try this........
select cast(current_timestamp(0) as timestamp(0) format 'YYYYMMDDHHMISS')
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.