Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 24th, 2004, 01:24 PM
Acorsys Acorsys is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 Acorsys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Time resets after 24 hours

Greetings,

I have a small problem. I need to extract data from a telephone system that has a built in SQL database, unfortunately I can't chagne any data types or how the data is stored. My query needs to calculate the amount of time a rep was on the phone (duration) I would like a total of this data as well (adding over months, etc.). Problem is, the time is stored in number of seconds. I would like to convert this to a time value, but every time I do it resets the hours after the 24th hour, (ex. rep on the phone for 29 hours, it will say 05:00:00, instead of 29:00:00). I'm a MySQL/Oracle programmer by nature, and I'm not familiar with SQL server's datatypes, can anyone provide any help on the query below to help with this.

SELECT distinct datename(q, date_time) as Quarter,
Convert(varchar(8), DateAdd(s, sum(duration),
DateAdd(day, DateDiff(day, 0, GetDate()), 0)), 108) AS 'Duration'
FROM MICROTEL.MCW_Calls
WHERE extension = '1102'
AND datename(q, date_time) = '2'
GROUP BY datename(q, date_time)
ORDER BY datename(q, date_time)


Thanks in advance,
Dominic

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Time resets after 24 hours


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