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
 Development Tools
 Reporting Services Development
 Calculating SUM using DateDiff

Author  Topic 

jkimpson
Starting Member

4 Posts

Posted - 2007-12-13 : 14:12:27
I have a report that needs to calculate the TOTAL_DAYS_WORKED based off of 3 different start and end date columns. The DateDiff function is working correctly but I am now having trouble getting the TOTAL_DAYS_WORKED for each.

Project Example Below:

NOTES_DURATION = 4
LAN_DURATION = 3
PC_DURATION = 1
TOTAL_DAYS_WORKED = ? - This is what I need to calculate

Any ideas on how to do this?

Thx,

Joyce

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-12-13 : 15:19:49
[code]
select
TOTAL_DURATION=NOTES_DURATION+LAN_DURATION+PC_DURATION
from
MyTable
[/code]

CODO ERGO SUM
Go to Top of Page

jkimpson
Starting Member

4 Posts

Posted - 2007-12-14 : 09:10:33
Thx Michael

That worked. It took me leaving my query to come back and think of that.

You Rock!!!!
:o)
Joyce

quote:
Originally posted by Michael Valentine Jones


select
TOTAL_DURATION=NOTES_DURATION+LAN_DURATION+PC_DURATION
from
MyTable


CODO ERGO SUM

Go to Top of Page
   

- Advertisement -