Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Subract time from a time

Author  Topic 

baburk
Posting Yak Master

108 Posts

Posted - 2009-03-13 : 04:00:33
Hi,

How to subtract this time 08:02:00.0000000 from 22:452:00.0000000

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-13 : 04:21:00
quote:
Originally posted by baburk

How to subtract this time 08:02:00.0000000 from 22:452:00.0000000

452 minutes?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

baburk
Posting Yak Master

108 Posts

Posted - 2009-03-13 : 04:38:10
quote:
Originally posted by Peso

quote:
Originally posted by baburk

How to subtract this time 08:02:00.0000000 from 22:452:00.0000000

452 minutes?


E 12°55'05.63"
N 56°04'39.26"




Hi,
I want in hh:mm:ss

format
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-13 : 06:22:50
What is 22:452:00.0000000?????
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-13 : 06:32:43
If you mean, '08:02:00:00','22:45:20:00'...

select convert(varchar,datediff(hour, '08:02:00:00','22:45:20:00'))+':'+convert(varchar,datediff(minute, '08:02:00:00','22:45:20:00')%60)+':'+convert(varchar,datediff(second, '08:02:00:00','22:45:20:00')%60)
Go to Top of Page
   

- Advertisement -