Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Null in Expression 1

Status
Not open for further replies.

BrianLe

Programmer
Joined
Feb 19, 2002
Messages
229
Location
US
In AC97, I have an expression that is the Control Source for the "Total Unit 1" report field. However, one of the "values" (i.e. CorrectionUnit1) may be Null. How do I get the null to be considered to be "0", so when the sum is performed the result will be the non-Null value?

The report's record source is qryWeightometer.

qryWeightometer

Code:
SELECT DISTINCTROW tblWeightometer.WeightometerDate, tblWeightometer.WeightometerUnit1, tblWeightometer.CorrectionUnit1, tblWeightometer.WeightometerUnit2, tblWeightometer.CorrectionUnit2, tblWeightometer.WeightometerUnit3, tblWeightometer.CorrectionUnit3
FROM tblWeightometer
WHERE ((tblWeightometer.WeightometerDate)>=Forms!frmWeightometerReport![tbxStartDate] And (tblWeightometer.WeightometerDate)<=Forms!frmWeightometerReport![tbxEndDate])

The control source expression for the "Unit 1 Total" field in the report is

Code:
=[WeightometerUnit1]+[CorrectionUnit1]

Thanks,

Brian
 
You may try this:
Code:
=Nz([WeightometerUnit1],0)+Nz([CorrectionUnit1],0)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Works great.

Thank you very much,

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top