I have a strange format that I need to convert to an Oracle Timestamp (no fractal seconds needed). I have two columns, date_entered, and time_entered, that have this format from our AS/400:
1110729 954
1110811 1216
1110815 1526
1110815 1659
1110817 1007
1110818 1000
1110821 1715
1110822 1320
1110823 1852
1110825 1743
1110826 1100
1110826 1559
1110826 1711
1110826 1906
The Date Column is an AS/400 date, with the 1st character as a y2k mark YYYMMDD. All dates are actually above year 2000, so that 1st character can be disregarded if needed.
Also, as you can see my time_entered field is a 24-hour timstamp, however it is a “number” field, so 3-digit rows are possible. I would like to write a SQL statement to convert this to an Oracle Timestamp. Not a function or anything, but just select statement to select the datetime of these two columns combined.
I have an Oracle instance and Sparky is correct with just a few minor modifications. Need to change the ‘+’ to ‘||’ and also need to change the ‘hh’ to ‘HH24’:
Sample shown below: