G
Guest
If a query returns no result, how can that result be treated as a 'zero' rather than just producing an empty result. For example: I write a query that counts the number of software licences available and the numbers actually deployed, but if no licences are deployed, rather than reporting that the count is zero, the query simply returns nothing. The SQL is:
SELECT qry_AllSoftwareByVersion.Company, qry_AllSoftwareByVersion.Title, qry_AllSoftwareByVersion.Version, qry_AllSoftwareByVersion.N_of_Licence, qry_CountSoftwareEquivalences.CountOfWS_NUM, [N_of_Licence]-[CountOfWS_NUM] AS Licences_Remaining
FROM qry_AllSoftwareByVersion INNER JOIN qry_CountSoftwareEquivalences ON (qry_AllSoftwareByVersion.Company = qry_CountSoftwareEquivalences.Company) AND (qry_AllSoftwareByVersion.Title = qry_CountSoftwareEquivalences.Title) AND (qry_AllSoftwareByVersion.Version = qry_CountSoftwareEquivalences.Version);
The query is based on two other queries: one reports the numbers of licences, the other the number of deployments.
SELECT qry_AllSoftwareByVersion.Company, qry_AllSoftwareByVersion.Title, qry_AllSoftwareByVersion.Version, qry_AllSoftwareByVersion.N_of_Licence, qry_CountSoftwareEquivalences.CountOfWS_NUM, [N_of_Licence]-[CountOfWS_NUM] AS Licences_Remaining
FROM qry_AllSoftwareByVersion INNER JOIN qry_CountSoftwareEquivalences ON (qry_AllSoftwareByVersion.Company = qry_CountSoftwareEquivalences.Company) AND (qry_AllSoftwareByVersion.Title = qry_CountSoftwareEquivalences.Title) AND (qry_AllSoftwareByVersion.Version = qry_CountSoftwareEquivalences.Version);
The query is based on two other queries: one reports the numbers of licences, the other the number of deployments.