Replace null values with zero

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a table where several cells are null. These null values are spread
across several fields. I know that I can convert these nulls to zeroes, using
update queries. However, I will have to run several update queries in order
to do this.

Is there any way to do this in one go?

Thanks,
Jyoti
 
Make yourself an update query. Set the 'update to' for each field you
want to change as:
Nz([Field1],0)

Run it.
One query, one solution.

~J
PS. This built-in fuction is self explanatory: Nz(arg, arg_if_null)
 
Make sure that you really want to replace the nulls with zeros. Zero is a
specific value and has a meaning. Null means that no value has been
specified. You can use the Nz() function in your calculations and this will
allow you to retain the nulls but not have them adversely impact your
results.

To update multiple fields at one go, create a calculation for each field:

Update To:
IIf(IsNull([SomeField], 0, [SomeField])
 
Thanks a lot! Works beautifully!

J said:
Make yourself an update query. Set the 'update to' for each field you
want to change as:
Nz([Field1],0)

Run it.
One query, one solution.

~J
PS. This built-in fuction is self explanatory: Nz(arg, arg_if_null)

Hello,

I have a table where several cells are null. These null values are spread
across several fields. I know that I can convert these nulls to zeroes, using
update queries. However, I will have to run several update queries in order
to do this.

Is there any way to do this in one go?

Thanks,
Jyoti
 
Back
Top