I have a sql query that formats a timestamp to the specs required, but now it does not sort properly and, not being a sql guru, I seem to be stuck. Here is a snippet of my query:
to_char((NEW_TIME(to_date('01-JAN-1970','DD-MM-YYYY')+ MB.transmit_TSTMP/86400, 'GMT', 'CST')), 'HH:MI:SS am mm/dd') AS TRANSMIT_TSTMP
The problem is that I need to order TRANSMIT_TSTMP by DESC, and when I do, it doesn't recognize that times that end with "pm" are later than "am", so 1:00 am is right next to 1:00 pm. Any help would be greatly appreciated.
to_char((NEW_TIME(to_date('01-JAN-1970','DD-MM-YYYY')+ MB.transmit_TSTMP/86400, 'GMT', 'CST')), 'HH:MI:SS am mm/dd') AS TRANSMIT_TSTMP
The problem is that I need to order TRANSMIT_TSTMP by DESC, and when I do, it doesn't recognize that times that end with "pm" are later than "am", so 1:00 am is right next to 1:00 pm. Any help would be greatly appreciated.