Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN
Home: Local Software with Web: royalblue:
SQL Code to convert time columns to hh:mm:ss

 

PreviousPrevious Thread    Next ThreadNext    Print Thread          
Author Subject:   SQL Code to convert time columns to hh:mm:ss

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

PreviousPrevious Thread    Next ThreadNext    Print Thread        
 
 


Search for (options) Powered by Gossamer Forum v.1.1.8