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 2005 Forums
 Transact-SQL (2005)
 Converting

Author  Topic 

Dobe
Starting Member

12 Posts

Posted - 2009-08-07 : 11:55:49
The following lines
select (DATEDIFF(mi, MIN(a.Timetag), MAX(a.Timetag)) /60) AS Hours
from table
Group by ......

Give me an integer. I am looking for a precision of 4 scale of 2. How do I do this?

Ifor
Aged Yak Warrior

700 Posts

Posted - 2009-08-07 : 12:45:32
SELECT CAST(DATEDIFF(mi, MIN(a.Timetag), MAX(a.Timetag)) /60.0) AS decimal(4,2)) AS Hours
Go to Top of Page

Dobe
Starting Member

12 Posts

Posted - 2009-08-07 : 12:46:55
Thank You, my friend
Go to Top of Page
   

- Advertisement -