I'm very familiar with casting a date/time into various formats to timestamp, but I'm hoping there's an EASY way to cast variable length items to TIMESTAMP.
Simple CAST as TIMESTAMP: Error 6760
CAST as TIMESTAMP FORMAT 'mm/dd/yyyyBhh:mi' : Error 6760 -- It will correctly cast the second data, but fails the first.
Likewise, the data I'm working with has 1 and 2 digit days as well.
Hi, This should work. Input Month is always in mm format like "02/23/2015 12:34". I'm just adding "0" to the month and casting it. Tested in 14.10.
Select '2/20/2015 16:03' as date1,
when strtok(date1, '/', 1) between 1 and 9 then '0'||date1
end as timestamp(0) format 'mm/dd/yyyyBhh:mi') as cast_date;