 BruceR
Member
Nov 14, 2001, 6:05 PM
|
SQL Code to convert time columns to hh:mm:ss
| Quote |
Reply |
|
I'm migrating a client's database to IncidentMonitor and had to develop the following to convert their time to hh:mm:ss. The following will convert their time columns such as TSTime to hh:mm:ss. select right("00" + ltrim(str(floor((calltme/16777216)))),2) + ":" + right("00" + ltrim(str(floor(((calltme - (floor((calltme/16777216)) * 16777216)) / 65536)))),2) + ":" + right("00" + ltrim(str( floor((calltme - ( (floor(calltme/16777216) * 16777216) + (floor(((calltme - (floor((calltme/16777216)) * 16777216)) / 65536)) * 65536))) / 256))), 2) as calltime from call |