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
 General SQL Server Forums
 New to SQL Server Programming
 days hours Minutes

Author  Topic 

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2008-04-18 : 12:32:30
I have two field and I need to find the sum I guess of them. One is called the clm_dout (process date) and the other one is clm_rcvd (received Date). These are both date and time fields and it looks like this 2006-03-17 00:00:00.000. I need to create a formula that wiil i guess give me the difference and create it into hour and minutes because I an trying to create a turn around report. this is what I had...

TimeValue({clm_doubt}-{clm_rcvd})

This is not working for me. Can someone give me a suggestion please.

Thanks!


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-18 : 13:42:23
SELECT DATEDIFF(n,clm_dout,clm_rcvd) /60 AS Hours, DATEDIFF(n,clm_dout,clm_rcvd) %60 AS Minutes FROM YourTable
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2008-04-18 : 14:45:33
Thanks for you help.

quote:
Originally posted by visakh16

SELECT DATEDIFF(n,clm_dout,clm_rcvd) /60 AS Hours, DATEDIFF(n,clm_dout,clm_rcvd) %60 AS Minutes FROM YourTable

Go to Top of Page
   

- Advertisement -