A
albert.repasky
I am trying to sum the fldHC, but it takes the field Planned as a
separate number and gives me 2 records and does not sum them. I just
can not see what I am doing wrong. I want to sum the Head Count if the
date is the same, the group is the same, the SAID is the same, and the
Location is the same. There are 2 Cost Codes for one SAID with
different Head Counts, so I does not add them to gether. I do not
select the Cost Code field, so why does it not sum up the fldHC?
Let me know if you need more info.
Thanks ahead of time.
Arep
SELECT tblHeadCount.fldMonthYear, tblSAID.fldGroup,
tblHeadCount.fldSAID, tblHeadCount.fldLocation,
Sum(tblHeadCount.fldHC) AS Planned
FROM tblSAID RIGHT JOIN tblHeadCount ON tblSAID.fldSAID =
tblHeadCount.fldSAID
GROUP BY tblHeadCount.fldMonthYear, tblSAID.fldGroup,
tblHeadCount.fldSAID, tblHeadCount.fldLocation, tblHeadCount.fldHC
HAVING (((tblHeadCount.fldHC)>0))
ORDER BY tblHeadCount.fldMonthYear, tblSAID.fldGroup,
tblHeadCount.fldSAID, tblHeadCount.fldLocation;
separate number and gives me 2 records and does not sum them. I just
can not see what I am doing wrong. I want to sum the Head Count if the
date is the same, the group is the same, the SAID is the same, and the
Location is the same. There are 2 Cost Codes for one SAID with
different Head Counts, so I does not add them to gether. I do not
select the Cost Code field, so why does it not sum up the fldHC?
Let me know if you need more info.
Thanks ahead of time.
Arep
SELECT tblHeadCount.fldMonthYear, tblSAID.fldGroup,
tblHeadCount.fldSAID, tblHeadCount.fldLocation,
Sum(tblHeadCount.fldHC) AS Planned
FROM tblSAID RIGHT JOIN tblHeadCount ON tblSAID.fldSAID =
tblHeadCount.fldSAID
GROUP BY tblHeadCount.fldMonthYear, tblSAID.fldGroup,
tblHeadCount.fldSAID, tblHeadCount.fldLocation, tblHeadCount.fldHC
HAVING (((tblHeadCount.fldHC)>0))
ORDER BY tblHeadCount.fldMonthYear, tblSAID.fldGroup,
tblHeadCount.fldSAID, tblHeadCount.fldLocation;