Hildegoat15
Technical User
I have a query that counts the number of clients, according to HOTID and by Bill Ref Code within that. My count numbers are all good, except that i want the records to show up where the count is zero. I'm thinking it has to do with my joins, but it won't let me do an outer join between Bill Ref Codes and True Complete Client List No Bill Ref - Start. I get the "there are ambiguous joins" error message. My SQL looks like this:
SELECT CLIENT.HOTID, [Bill Ref Codes].[Bill Ref Code] AS bref, Count(Nz([true complete client list no bill ref - start]![clientid],0)) AS clientid
FROM [Bill Ref Codes] INNER JOIN ([true complete client list no bill ref - start] INNER JOIN CLIENT ON [true complete client list no bill ref - start].clientid = CLIENT.CLIENTID) ON [Bill Ref Codes].[Bill Ref Code] = [true complete client list no bill ref - start].bref
GROUP BY CLIENT.HOTID, [Bill Ref Codes].[Bill Ref Code]
HAVING ((([Bill Ref Codes].[Bill Ref Code])<>"S-01" And ([Bill Ref Codes].[Bill Ref Code])<>"X-88" And ([Bill Ref Codes].[Bill Ref Code])<>"X-99"
)
ORDER BY CLIENT.HOTID, [Bill Ref Codes].[Bill Ref Code];
can anyone tell me how i can show ALL the records, even if the count is zero?
SELECT CLIENT.HOTID, [Bill Ref Codes].[Bill Ref Code] AS bref, Count(Nz([true complete client list no bill ref - start]![clientid],0)) AS clientid
FROM [Bill Ref Codes] INNER JOIN ([true complete client list no bill ref - start] INNER JOIN CLIENT ON [true complete client list no bill ref - start].clientid = CLIENT.CLIENTID) ON [Bill Ref Codes].[Bill Ref Code] = [true complete client list no bill ref - start].bref
GROUP BY CLIENT.HOTID, [Bill Ref Codes].[Bill Ref Code]
HAVING ((([Bill Ref Codes].[Bill Ref Code])<>"S-01" And ([Bill Ref Codes].[Bill Ref Code])<>"X-88" And ([Bill Ref Codes].[Bill Ref Code])<>"X-99"
ORDER BY CLIENT.HOTID, [Bill Ref Codes].[Bill Ref Code];
can anyone tell me how i can show ALL the records, even if the count is zero?