Replace null values with zero

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
 
J

J

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)
 
P

Pat Hartman \(MVP\)

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])
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top