Null value

  • Thread starter Thread starter Oded Dror
  • Start date Start date
O

Oded Dror

Hi there,

I'm using Access 2002 on Windows XP,

I have a table with three columns ID (PK), QtyA and QtyB

I created a Qry called qryTotals base on this table and a add one column to
it called Totals so
my qryTotals look like this:
QtyA
QtyB
Totals: [QtyA]+[QtyB]

Everyting works fine if both records contains a values another words
QtyA = 3 and QtyB = 2 then the Total will show 5
but if QtyA = 3 and QtyB = Null (no value) then the Totals vill show Null no
value

My question is how to make the total to show the value from QtyA even if
QtyB is null
like this QtyA + QtyB = 3 instead of null ? (same things for subtraction)

Thanks,

Oded Dror
Email: (e-mail address removed)
 
You can use the NZ() function. In a query, you would use it as follows:

Total: NZ(QtyA, 0) + NZ(QtyB, 0)
 
Back
Top