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 2000 Forums
 Transact-SQL (2000)
 calculating diiference in time values

Author  Topic 

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-02-11 : 21:25:12
Hi All,

I have two fields in my table.. starttime and endtime
how can i get the difference btween these two times ?

Is this possible?
I am using sqlserver 2000

Can anyone please help me in this?

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-02-11 : 21:37:33
yes. This is possible. You can use datediff() function

select [diff in seconds] = datediff(second, starttime, endtime),
[diff in minutes] = datediff(minute, starttime, endtime),
[diff in hours] = datediff(hour, starttime, endtime)



KH

Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-02-11 : 21:45:01
thanks for the reply
I will try this way
Go to Top of Page
   

- Advertisement -