I
Inquisitive1
I am wondering if there is a way to use a query to return a group and 0
value if the group did not meet the criteria.
Below is the SQL to my query:
SELECT [tblMaster-ApprovedSourcing].[Commodity Code],
Count([tblMaster-ApprovedSourcing].CertStatus) AS CountOfCertStatus
FROM [tblMaster-ApprovedSourcing]
WHERE ((([tblMaster-ApprovedSourcing].CertStatus) Like "*sales*" Or
([tblMaster-ApprovedSourcing].CertStatus) Like "*corp*" Or
([tblMaster-ApprovedSourcing].CertStatus) Like "*dist*"))
GROUP BY [tblMaster-ApprovedSourcing].[Commodity Code];
This query returns the following:
C 1
M 1
The problem is that I am missing two Commodity Codes from the results.
I would like to show E with a 0 and Unknown with a 0 (both of these
commodity codes are in the tblMaster-ApprovedSourcing). I looked up
the Nz function by reading another post with a similar issue, but I do
not understand how to use it in a query.
Can somebody please help me?
Thanks!
value if the group did not meet the criteria.
Below is the SQL to my query:
SELECT [tblMaster-ApprovedSourcing].[Commodity Code],
Count([tblMaster-ApprovedSourcing].CertStatus) AS CountOfCertStatus
FROM [tblMaster-ApprovedSourcing]
WHERE ((([tblMaster-ApprovedSourcing].CertStatus) Like "*sales*" Or
([tblMaster-ApprovedSourcing].CertStatus) Like "*corp*" Or
([tblMaster-ApprovedSourcing].CertStatus) Like "*dist*"))
GROUP BY [tblMaster-ApprovedSourcing].[Commodity Code];
This query returns the following:
C 1
M 1
The problem is that I am missing two Commodity Codes from the results.
I would like to show E with a 0 and Unknown with a 0 (both of these
commodity codes are in the tblMaster-ApprovedSourcing). I looked up
the Nz function by reading another post with a similar issue, but I do
not understand how to use it in a query.
Can somebody please help me?
Thanks!