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)
 Conversion - Minutes Instead of Seconds

Author  Topic 

decem
Starting Member

21 Posts

Posted - 2004-04-29 : 14:16:30
case
when (QLength - NumCallAbandoneInQ) = 0 then 0
else CAST ((CAST (BeforeAnswerDuration as numeric (6,2)) /
(CAST (QLength as numeric (6,2)) - CAST (NumCallAbandoneInQ as numeric (6,2))) / 60 ) as numeric (6,2))
end as [Avg_Wait_Time_AnsweredCalls],

qlength, numcallabandoneinq and beforeanswerduration return the number of seconds, which is fine. but i want avg_wait_time_answeredcalls to be in minutes (mm:ss). right now i have it dividing by 60 but this gives 2.5 for 150 seconds instead of 2:30 as i would like it to. how can i make it return as mm:ss?

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-04-29 : 15:11:36
You can use modulo

select 5 % 4

returns 1 ie 1 remainder 1

so if the remainder of the division (%) is 0.5 then 0.5 * 60 = 30



Duane.
Go to Top of Page
   

- Advertisement -