Duane,
You have hit the nail on the head. Since I'm calculating info on each detail record for various counts and categories it is very much un-normalized. This is fine as I process all the detail on the report without any problem and also because I make those lines invisible.My problem (and perhaps this problem is self-inflicted, is that when I get to my subtotals (where I want to print the totals of what came through I have hard coding into the report descriptions and codes that go with the hrs. Its the categories that have zero hours that I don't want to print those hard coded descriptions. Perhaps there is a way to print them some other way. This is where I'm stuck. Here is a copy of the query that is run prior to opening the report. It's quite ugly and very complicated based on many table joins and unions. While it gives me the detail I need, its at subtotal time that I'm challenged. A where clause is programmatically built and added on to each query before the report runs which you don't see here now.
SELECT dbo_EmpSickVacs.lEmpID, dbo_Emp.lEmpInfoID, dbo_EmpInfo.zBadgeID, dbo_Emp.lDeptID, dbo_Dept.zDeptDesc, dbo_EmpInfo.zLName, dbo_EmpInfo.zFName, dbo_EmpInfo.zMName, dbo_EmpActPer.bActive, dbo_EmpActPer.bFullTime, dbo_EmpActPer.dtActStart, dbo_EmpActPer.dtActEnd, dbo_Schedule.Date_, dbo_Schedule.zID, dbo_Schedule.Type, dbo_Schedule.Hrs, dbo_EmpSickVacs.snWkHoursADay,
IIf([Type]="Hour OT" And ([zID]<>"BBQ Contest" And [zID]<>"PARKS-BIKE RIDE" And [zID]<>"DUI Grnt#211760" And [zID]<>"STEP Gr #211770"),[Hrs],0) AS OThr,
IIf([zID]="Ha",[snWkHoursADay],0) AS HaHr,
IIf([zID]="H" Or [zID]="PtH",[snWkHoursADay],0) AS HHr,
IIf([zID]="BBQ Contest",[Hrs],0) AS BBQ,
IIf([zID]="PARKS-BIKE Ride",[Hrs],0) AS Bike,
IIf([zID]="DUI Grnt#211760",[Hrs],0) AS DUI,
IIf([zID]="STEP Gr #211770",[Hrs],0) AS STEP,
IIf(([zID]="C" And [Hrs]>0),[Hrs],IIf([zID]="C" And [snWkHoursADay]>0,[snWkHoursADay],0)) AS [Comp],
IIf([zID]="WC",[Hrs],0) AS WC,
IIf(([zID]="ill" Or [zID]="Mat" Or [zID]="z-ill"),[snWkHoursADay],0) AS ill,
IIf([zID]="F",[Hrs],0) AS Funeral,
IIf([zID]="V" Or [zID]="V-10",[snWkHoursAday],0) AS Vhr,
IIf([zID]="pH",[snWkHoursAday],0) AS pH,
IIf([zID]="Mil",[snWkHoursAday],0) AS Mil,
IIf((([zID]="LWOP" Or [zID]="ADM" Or [zID]="SUS") And [Hrs]>0),[Hrs],
IIf((([zID]="LWOP" Or [zID]="ADM" Or [zID]="SUS") And [snWkHoursAday]>0),[snWkHoursAday],0)) AS LWOP,
IIf([zID]="Ltd",[snWkHoursAday],0) AS Ltd,
IIf([zID]="Jry",[snWkHoursAday],0) AS Jury,
IIf([zID]="FM",[snWkHoursAday],0) AS FMLA,
IIf([zID]="std",[snWkHoursAday],0) AS std,
IIf([zID]="W",[snWkHoursAday],0) AS Well,
IIf((([zBadgeID]="4230" And "7874" And "8107") And [Type]="Hour OT"),[Hrs],IIf(([zBadgeID]="4230" And "7874" And "8107") And [Type]="Job",[Hrs],0)) AS PartTimehrs
FROM ((((dbo_EmpActPer INNER JOIN dbo_Emp ON dbo_EmpActPer.lEmpID = dbo_Emp.lEmpID)
INNER JOIN dbo_EmpInfo ON dbo_Emp.lEmpInfoID = dbo_EmpInfo.lEmpInfoID)
INNER JOIN dbo_Dept ON dbo_Emp.lDeptID = dbo_Dept.lDeptID)
INNER JOIN dbo_Schedule ON (dbo_EmpInfo.zLName = dbo_Schedule.LName) AND (dbo_EmpInfo.zFName = dbo_Schedule.FName) AND (dbo_Dept.zDeptDesc = dbo_Schedule.Department))
INNER JOIN dbo_EmpSickVacs ON dbo_EmpActPer.lEmpID = dbo_EmpSickVacs.lEmpID
ORDER BY dbo_Emp.lDeptID, dbo_EmpInfo.zLName, dbo_EmpInfo.zFName, dbo_EmpInfo.zMName;