to_char(resolved_date-opened_date, 'hh24:mi') I am using the below to return the hh:mm difference between two date ranges. How would I update this code to minus the hours by 5?
CURRENT CODE = to_char(resolved_datetime-opened_datetime, 'hh24:mi')
CURRENT RESULTS = 06:35
NEW RESULTS = 01:35
resolved_datetime timestamp
opened_datetime timestamp
You can subtract the five hours from the resulting interval, before the formatting takes place:
to_char(resolved_datetime - opened_datetime - interval '5 hour', 'hh24:mi')


Note that to_char(..., 'hh24:mi') on an interval, might not give you what you want, if the difference is greater than 24 hours, e.g. an interval of 2 days 3 hours 5 minutes formatted with that, will display as 03:05, not as 51:05