E
Engels
I am trying to use the NZ function to return null values from my query. The
query is off a table called "Training Course" and another table related
(through training course pk [Course ID] ) called "Extra Equipment".
It simply uses an expression to sum a few values in the "Extra Equipment"
table that correspond to the PK from Training Course. What i need it to do is
return the value '0' alongside the Course ID when there is no corresponding
data in the Extra Equipment table. At the moment even with the code below it
only returns the [Course ID]'s and corresponding values of that data which in
"Extra Equipment"
ExtraEquipSumCost: Sum(Nz([Cost],0)
Current SQL:
SELECT DISTINCTROW [Training Course].[Course ID], Nz(Sum(Nz([Cost],0)),0) AS
ExtraEquipSumCost
FROM [Training Course] INNER JOIN [Extra Equipment] ON [Training
Course].[Course ID] = [Extra Equipment].[Course ID]
GROUP BY [Training Course].[Course ID];
query is off a table called "Training Course" and another table related
(through training course pk [Course ID] ) called "Extra Equipment".
It simply uses an expression to sum a few values in the "Extra Equipment"
table that correspond to the PK from Training Course. What i need it to do is
return the value '0' alongside the Course ID when there is no corresponding
data in the Extra Equipment table. At the moment even with the code below it
only returns the [Course ID]'s and corresponding values of that data which in
"Extra Equipment"
ExtraEquipSumCost: Sum(Nz([Cost],0)
Current SQL:
SELECT DISTINCTROW [Training Course].[Course ID], Nz(Sum(Nz([Cost],0)),0) AS
ExtraEquipSumCost
FROM [Training Course] INNER JOIN [Extra Equipment] ON [Training
Course].[Course ID] = [Extra Equipment].[Course ID]
GROUP BY [Training Course].[Course ID];