Hi,
I have the following query:
It displays something like:
Month CountOfPID PID LocID WOLoc
1 8 101866 RVW Bartow
1 1 101866 RVW Bartow
1 2 101868 BTW South Fort Meade
1 6 101868 BTW South Fort Meade
1 1 101870 SFM Green Bay
1 3 101870 SFM Green Bay
1 5 101870 SFM Riverview
I would like it to display:
Month CountOfPID PID LocID WOLoc
1 9 101866 RVW Bartow
1 8 101868 BTW South Fort Meade
1 4 101870 SFM Green Bay
1 5 101870 SFM Riverview
I can't figure out how to get it to combine the count when the LocID and the WOLoc are identical for the PID.
Thanks for any help!
I have the following query:
Code:
SELECT Month([WOD]) AS [Month], Count(U.PID) AS CountOfPID, U.PID, tblLoc.LocID, U.WOLoc
FROM (tblPersonal AS P INNER JOIN tblFCUtil AS U ON P.PID = U.PID) INNER JOIN tblLoc ON P.LocW = tblLoc.LocID
WHERE (((U.WOD) Between [Forms]![fdlgOps]![txtStart] And [Forms]![fdlgOps]![txtEnd]) AND (((SELECT Count(*) FROM tblFCUtil WHERE PID = U.PID AND WOD Between [Forms]![fdlgOps]![txtStart] And [Forms]![fdlgOps]![txtEnd]))>=8))
GROUP BY Month([WOD]), U.PID, tblLoc.LocID, U.WOLoc;
It displays something like:
Month CountOfPID PID LocID WOLoc
1 8 101866 RVW Bartow
1 1 101866 RVW Bartow
1 2 101868 BTW South Fort Meade
1 6 101868 BTW South Fort Meade
1 1 101870 SFM Green Bay
1 3 101870 SFM Green Bay
1 5 101870 SFM Riverview
I would like it to display:
Month CountOfPID PID LocID WOLoc
1 9 101866 RVW Bartow
1 8 101868 BTW South Fort Meade
1 4 101870 SFM Green Bay
1 5 101870 SFM Riverview
I can't figure out how to get it to combine the count when the LocID and the WOLoc are identical for the PID.
Thanks for any help!