Posts

Showing posts with the label bi-publisher

Oracle SQL - Using TO_DATE to add a second to a time pulled from a string

Image
Clash Royale CLAN TAG #URR8PPP Oracle SQL - Using TO_DATE to add a second to a time pulled from a string This is building on the question I asked yesterday Link I'm pulling time from the 'Flight' column whose data looks like this: Dayton 01:23:59 Which gives me this: 01:23:59 I then want to add 1 second to this. I'm using the following TO_DATE function: to_date(substr(Flight,length(Flight)-8,8), HH:MI:SS') + interval '1' second This works but the format includes the date: 2018-07-01T01:24:00.000+00:00 I need it to look like this: 01:24:00 I've tried using the SUBSTR to extract only the time to no avail. Any ideas on how I can add 1 second to the above and preserve the HH24:MI:SS format? Use to_char() to convert it back to a string. – Gordon Linoff 1 hour ago to_char() @GordonLinof...