D
Dos Equis
Hi all,
Using this code:
SELECT tbl_Carrier.CID, [CNameFirst] & " " & [CNameLast] AS
Name,Cint(NZ(Count(tbl_Complaint.Complaint),0)) AS [Num of chargable
complaints]
FROM (tbl_Carrier INNER JOIN (tbl_Area INNER JOIN tbl_SubscribersData
ON tbl_Area.AreaID = tbl_SubscribersData.AreaID) ON tbl_Carrier.CID =
tbl_Area.CID) INNER JOIN tbl_Complaint ON tbl_SubscribersData.SubID =
tbl_Complaint.SubID
WHERE (((tbl_Complaint.CompDate)>=Date()-7))
GROUP BY tbl_Carrier.CID, [CNameFirst] & " " & [CNameLast],
tbl_Complaint.Repeat
HAVING (((tbl_Complaint.Repeat)=True))
ORDER BY [CNameFirst] & " " & [CNameLast];
I end up with a total of 1 record:
3, Robert M, 1
I should have 5 records:
1, Gina R, 0
2, Terry T, 0
3, Robert M, 1
4, Richard G, 0
5, Bruce G, 0
I was thinking that forcing 0's would return the array above rather
than the single record I can get without the Nz.
Please tell me what I'm doing wrong.
Byron
Using this code:
SELECT tbl_Carrier.CID, [CNameFirst] & " " & [CNameLast] AS
Name,Cint(NZ(Count(tbl_Complaint.Complaint),0)) AS [Num of chargable
complaints]
FROM (tbl_Carrier INNER JOIN (tbl_Area INNER JOIN tbl_SubscribersData
ON tbl_Area.AreaID = tbl_SubscribersData.AreaID) ON tbl_Carrier.CID =
tbl_Area.CID) INNER JOIN tbl_Complaint ON tbl_SubscribersData.SubID =
tbl_Complaint.SubID
WHERE (((tbl_Complaint.CompDate)>=Date()-7))
GROUP BY tbl_Carrier.CID, [CNameFirst] & " " & [CNameLast],
tbl_Complaint.Repeat
HAVING (((tbl_Complaint.Repeat)=True))
ORDER BY [CNameFirst] & " " & [CNameLast];
I end up with a total of 1 record:
3, Robert M, 1
I should have 5 records:
1, Gina R, 0
2, Terry T, 0
3, Robert M, 1
4, Richard G, 0
5, Bruce G, 0
I was thinking that forcing 0's would return the array above rather
than the single record I can get without the Nz.
Please tell me what I'm doing wrong.
Byron