If a query finds a null value is It possible to write an expression that will change it to a default value like zero? As you can see from my query results VPO 333333 has a null for 'SumOfVPOAmount'. This is because I payment has not yet been made against that VPO. The purpose of this database is to track payments against various VPOs.
I should also explain that this is a sub query I'm running from two different queries, not tables, so it's not as easy as an update function... or atleast I don't think it is... but I could be wrong.
This is the query I'm using:
SELECT VPO.VPONumber, VPO.VendorCode, [2VPOTotalByVPO].SumOfTotalCost, Sum([3PaymentTotalsByVPO].VPOAmountPaid) AS SumOfVPOAmountPaid
FROM 3PaymentTotalsByVPO RIGHT JOIN (2VPOTotalByVPO INNER JOIN VPO ON [2VPOTotalByVPO].VPONumber = VPO.VPONumber) ON [3PaymentTotalsByVPO].VPO_VPONumber = VPO.VPONumber
GROUP BY VPO.VPONumber, VPO.VendorCode, [2VPOTotalByVPO].SumOfTotalCost;
I should also explain that this is a sub query I'm running from two different queries, not tables, so it's not as easy as an update function... or atleast I don't think it is... but I could be wrong.

This is the query I'm using:
SELECT VPO.VPONumber, VPO.VendorCode, [2VPOTotalByVPO].SumOfTotalCost, Sum([3PaymentTotalsByVPO].VPOAmountPaid) AS SumOfVPOAmountPaid
FROM 3PaymentTotalsByVPO RIGHT JOIN (2VPOTotalByVPO INNER JOIN VPO ON [2VPOTotalByVPO].VPONumber = VPO.VPONumber) ON [3PaymentTotalsByVPO].VPO_VPONumber = VPO.VPONumber
GROUP BY VPO.VPONumber, VPO.VendorCode, [2VPOTotalByVPO].SumOfTotalCost;
Last edited: