msanderson
New member
- Local time
- Today, 12:39
- Joined
- Mar 27, 2015
- Messages
- 3
I have a table in Access with corrected pay data for a whole year. The important columns are PPC, PPP, wk1hours, wk2hours. I want to sum the week one and two hours but only for the most highest pay period processed(PPP). So a time sheet for pay period 10 was corrected and processed in pay period 11. It was then corrected and processed again in pay period 12. I only want the totals for pay period 12.
SELECT [combined corrected TA data].lastname, [combined corrected TA data].[Fiscal Year], [combined corrected TA data].ppcov, Max([combined corrected TA data].PPproc) AS MaxOfPPproc, Sum([wk1hrs]+[wk2hrs]) AS Hours
FROM [combined corrected TA data]
GROUP BY [combined corrected TA data].lastname, [combined corrected TA data].[Fiscal Year], [combined corrected TA data].ppcov
HAVING ((([combined corrected TA data].ppcov)="10"));
In this example the results show PPP as 12, but it's totaling the hours from PPP11 and PPP12 instead of just 12, giving me duplicate hours.
SELECT [combined corrected TA data].lastname, [combined corrected TA data].[Fiscal Year], [combined corrected TA data].ppcov, Max([combined corrected TA data].PPproc) AS MaxOfPPproc, Sum([wk1hrs]+[wk2hrs]) AS Hours
FROM [combined corrected TA data]
GROUP BY [combined corrected TA data].lastname, [combined corrected TA data].[Fiscal Year], [combined corrected TA data].ppcov
HAVING ((([combined corrected TA data].ppcov)="10"));
In this example the results show PPP as 12, but it's totaling the hours from PPP11 and PPP12 instead of just 12, giving me duplicate hours.