Michael R Mattys
mmattys at rochester.rr.com
Wed Dec 20 17:18:49 CST 2006
Maybe this will work: strSQL = "SELECT [t1].[Year],[t1].[Month], [t1].[Entity], Sum([t1].[SumOfRegPay]) AS [Reg StandCost], Sum([t1].[SumOfOvtPay]) AS [OTStandard Cost], Sum([t1].[SumOfOvt2Pay]) AS [OT2 Standard Cost], Sum([sumofregpay]+[sumofovtpay]+[sumofovt2pay]) AS [Total Standard Cost], Sum([t1].[ActReg]) AS [Calc Reg Cost], Sum([t1].[ActOvt]) AS [Calc OT Cost], Sum([t1].[ActOvt2]) AS [Calc OT2 Cost], Sum([t1].[actreg]+[t1].[actovt]+[t1].[actovt2]) AS [Total Calc Cost], First([t3].[SumOfAmountPaid]) AS FirstOfSumOfAmountPaid, First([t2].[SumOfHrs]) AS FirstOfSumOfHrs, First([t2].[SumOfWageDiff]) AS FirstOfSumOfWageDiff FROM qryPayrollDiffSummary As t2 RIGHT JOIN (qryPayrollPaid As t3 RIGHT JOIN qryWeeklyTimesheetVarianceSummary As t1 ON ([t3].[Year]=[t1].[Year]) AND ([t3].[Month]=[t1].[Month]) AND ([t3].[Entity]= [t1].[Entity]) ) ON ([t2].[Entity]=[t1].[Entity]) AND ([t2].[Month]= [t1].[Month]) AND ([t2].[Year]=[t1].[Year]) WHERE [t1].[Entity] = '00' And [t1].[Month] = 10 And [t1].[Year] = 2006 GROUP BY [t1].[Year], [t1].[Month], [t1].[Entity]" Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Keith Williamson" <Kwilliamson at rtkl.com> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Wednesday, December 20, 2006 5:59 PM Subject: Re: [AccessD] Unbound Subform Revisited > Well....I tried that, as follows: > > Dim strSQL As String <snip>