Full Version: How can I treat null value as zero?
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
steven381
When [PaymentAmount] or [discountAmount] are null access returns a null result. I would like to treat the null value as zero for this calculation.

SELECT Payments.TenantName, Payments.PaymentAmount, Payments.discountAmount, [PaymentAmount]-[discountAmount] AS Expr1
FROM Payments;


Thanks Steven
dashiellx2000
Try:

CODE
SELECT Payments.TenantName, Payments.PaymentAmount, Payments.discountAmount,
Nz([Payments]![PaymentAmount],0)-Nz([Payments![discountAmount],0) AS Expr1
FROM Payments;


HTH.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.