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)
 number of calls per hour, not minutes

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2008-02-25 : 07:18:55
hi,
I am working out the number of minutes using :

(datediff(mi, min(starttime), max(endtime))) AS total_mins

once I have the number of mins eg, 327. how can I convert it back to hours to then show :

number of calls taken / total_mins =
the number of calls taken per hour

thank you for any help
jamie

jamie
Aged Yak Warrior

542 Posts

Posted - 2008-02-25 : 07:21:26
thinking about it, can I do :

(cast(no_of_calls as float) / cast(Total_mins as float)) * 60

to show number per hour ?!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-25 : 07:26:00
What happened when you tried?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2008-02-25 : 08:02:52
looked good to me..
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-25 : 08:12:25
Also, there is no need to convert

60.0 * no_of_calls / Total_mins



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -