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
 General SQL Server Forums
 New to SQL Server Programming
 How To Remove Detail From Report

Author  Topic 

pgmr1998
Yak Posting Veteran

66 Posts

Posted - 2008-09-18 : 12:20:07
I am attempting to create a summarized report by ActEmpCCGrp2, and within that, by ActBillingPeriod, and within that, by ActPrjCode.
I am getting too much detail, and I attempted to remove the detail using a GROUP BY clause. But I am still getting a lot of detail. How can i remove the detail from the report?
Here is my code:

select ActPrjCode, ActBillingPeriod, ActTimevalue,
ActivityCode, ActEmpCCGrp2
from dbo.ACTIVITIES
where ActBudCat = 'labor'
and actbillingperiod >= '2007/01/01'
group by ActEmpCCGrp2, ActBillingPeriod, ActPrjCode,
ActTimevalue,ActivityCode
order by ActEmpCCGrp2, ActBillingPeriod, ActPrjCode

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 12:37:03
without seeing what data you mean by detail and you want to remove, how can we suggest a solution. so please post some sample data and also output you desire from it.
Go to Top of Page

pgmr1998
Yak Posting Veteran

66 Posts

Posted - 2008-09-18 : 14:21:00
Here is what I am getting:
06801690 2007-03-15 09:17:47.000 .0000 NULL
2007-07-13 00:00:00.000 7.0000 Regular NULL
2007-07-13 00:00:00.000 2.0000 Regular NULL
2007-07-13 00:00:00.000 30.0000 Regular NULL
2007-07-27 00:00:00.000 4.5000 Regular NULL
2007-07-27 00:00:00.000 3.0000 Regular NULL
2007-07-27 00:00:00.000 36.0000 Regular NULL

Here is what I want to get:
06801690 2007-03-15 09:17:47.000 .0000 NULL
2007-07-13 00:00:00.000 39.0000 Regular NULL
2007-07-27 00:00:00.000 43.5000 Regular NULL
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 14:25:17
quote:
Originally posted by pgmr1998

Here is what I am getting:
06801690 2007-03-15 09:17:47.000 .0000 NULL
2007-07-13 00:00:00.000 7.0000 Regular NULL
2007-07-13 00:00:00.000 2.0000 Regular NULL
2007-07-13 00:00:00.000 30.0000 Regular NULL
2007-07-27 00:00:00.000 4.5000 Regular NULL
2007-07-27 00:00:00.000 3.0000 Regular NULL
2007-07-27 00:00:00.000 36.0000 Regular NULL

Here is what I want to get:
06801690 2007-03-15 09:17:47.000 .0000 NULL
2007-07-13 00:00:00.000 39.0000 Regular NULL
2007-07-27 00:00:00.000 43.5000 Regular NULL



GROUP BY all except ActTimeValue (field prior to Regular) and apply SUM() on it.
Go to Top of Page
   

- Advertisement -