Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 25th, 2007, 07:42 AM
yasinirshad yasinirshad is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 119 yasinirshad Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 8 h 4 m 34 sec
Reputation Power: 0
Other Language - How do I Calculate Average Leadtime in sqlserver...

Hi, The below query calculates hours and minutes seperately and gives the output as :

Quote:
2007-09-18 09:47:00(Req_Date), 2007-09-18 10:50:00(CLOSED_DATE),1(TICKET),1(HOURS), 3(MINUTES),63(TOTALMINS).

As we can see am getting 1 hours and 3 minutes as seperate columns.. But i need it as 1.3 hours (minutes i dont want seperately. Can anyone please send me the query for this.


Code:
SELECT     dbo.iCalls_Calls.REQ_DATE, dbo.iCalls_Calls.CLOSED_DATE,
 COUNT(*) AS TICKET, FLOOR(DATEDIFF(MI, dbo.iCalls_Calls.REQ_DATE, 
                      dbo.iCalls_Calls.CLOSED_DATE) / 60) AS HOURS,
 DATEDIFF(MI, dbo.iCalls_Calls.REQ_DATE, dbo.iCalls_Calls.CLOSED_DATE)
 - FLOOR(DATEDIFF(MI, dbo.iCalls_Calls.REQ_DATE, dbo.iCalls_Calls.CLOSED_DATE)
 / 60) * 60 AS MINUTES, DATEDIFF(MI, dbo.iCalls_Calls.REQ_DATE, 
                    dbo.iCalls_Calls.CLOSED_DATE) AS TOTALMINS
FROM         dbo.iCalls_Calls INNER JOIN
                      dbo.iCalls_Users ON dbo.iCalls_Calls.REQUESTOR = dbo.iCalls_Users.USER_ID
WHERE     (dbo.iCalls_Calls.STATUS_ID = 3)
GROUP BY dbo.iCalls_Calls.REQ_DATE, dbo.iCalls_Calls.CLOSED_DATE


Thanks a lot...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Other Language - How do I Calculate Average Leadtime in sqlserver...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT