Nz and Dsum

Super Contributor



How would I add Nz to the below AmendSum Dsum statement?  I think I need to add Nz if the "Amount" is null.  The amount is NULL in tblFXAmends where IDFXfk]= & [ID] (I did set the default value to 0 but there are a few records that are still NULL)


AmendSum: Format(DSum("Amount","tblFXAmends","[IDFXfk]=" & [ID]),"Standard")


this is my entire query:

SELECT tblBanks.BankID, tblFX2.Notional, Format(DSum("Amount","tblFXAmends","[IDFXfk]=" & [ID]),"Standard") AS AmendSum, Nz([Notional],0)+(DSum("Amount","tblFXAmends","[IDFXfk]=" & [ID])) AS GTotal
FROM tblFX2 INNER JOIN tblBanks ON tblFX2.Bank = tblBanks.BankID;


thank you

2 Replies
best response confirmed by Tony2021 (Super Contributor)
Just add Nz in the following concept
Perfect. I thought I tried that but I guess I made a mistake somewhere. anyways, it works. thank you