Thanks Suneel,

Here's what happens when I run the query:

Server: Msg 517, Level 16, State 1, Line 6
Adding a value to a 'datetime' column caused overflow.

Any idea? btw it's Rodopi 5.2sp3

- Darren

On Tue, 2004-02-03 at 17:53, Suneel Jhangiani wrote:
> I can't remember the UsageData_OnlineHours (careful there was a name
> change between version 5.1 and 5.2 if I remember correct) table, but
> what you would need is something like:
> 
> ---
> DECLARE @StartDate datetime, @EndDate datetime
> 
> SELECT @StartDate = '20040101'
> SELECT @EndDate = '20040107'
> 
> SELECT SUM(AcctSessionTime) FROM UsageData_OnlineHours
> WHERE 
>       @StartDate < SessionDate
> AND
>       DATEADD(ss,AcctSessionTime,SessionDate) < @EndDate
> ---
> 
> 
> Please be aware the code above will drop all connections that occur
> before the EndDate where the duration would take them past the EndDate.
> 
> 
> 
> ---
> If life gives you lemons, stick them down your shirt and make your boobs
> 
> look bigger.
> 
> 
> (--------------------------------)         {((((((
> (     Suneel Jhangiani           )        /_  _  )
> (    Technical Director          )       ( .  .   )
> ( Inter-Computer Technology Ltd. )        ( /   )
> (----------------------------------oOOo------------oOOo----)
> ( 40 James Street                Tel: +44 (0) 20 7486 9601 ) 
> ( London W1U 1EU                 Fax: +44 (0) 7050 678 978 )
> ( United Kingdom               Email: [EMAIL PROTECTED]     )
> (             Website: http://www.inctech.com              ) 
> (----------------------------------------------------------)
> 
> 
> 
> 
> -----Original Message-----
> From: Darren [mailto:[EMAIL PROTECTED] 
> Sent: 03 February 2004 19:07
> To: [EMAIL PROTECTED]
> Subject: [Rodopi] Query help.
> 
> Hello,
> 
> Does anyone have a query to get the total amount of time used for all
> dial-up users over a particular time period?
> 
> Thanks,
> 
> - Darren
> 
> 
> 
> 
> ---------------------
> To Leave the Rodopi mail list send a message to
> [EMAIL PROTECTED] 
> with the word LEAVE as the message body.
> 
> Please also visit the Rodopi FAQ at http://www.rodopi-faq.com
> ---------------------
> 
> 
> 
> 
> 
> ---------------------
> To Leave the Rodopi mail list send a message to [EMAIL PROTECTED] 
> with the word LEAVE as the message body.
> 
> Please also visit the Rodopi FAQ at http://www.rodopi-faq.com
> ---------------------




---------------------
To Leave the Rodopi mail list send a message to [EMAIL PROTECTED] 
with the word LEAVE as the message body.

Please also visit the Rodopi FAQ at http://www.rodopi-faq.com
---------------------

Reply via email to