Null values

J

Jrmrcol

Hi, I have a table with multiple null values in multiple columns. how
can I replace all null values in this table for zero. all at once.
Thanks for your help.
 
G

Guest

Use this replacing your tablble and field names.
UPDATE YourTable SET YourTable.YourField = 0
WHERE (((YourTable.YourField) Is Null));
 
J

Jrmrcol

Use this replacing your tablble and field names.
UPDATE YourTable SET YourTable.YourField = 0
WHERE (((YourTable.YourField) Is Null));

--
KARL DEWEY
Build a little - Test a little





- Show quoted text -

Hi Karl, thanks for helping me out.

The problem that I have with this table is to have multiple fields
with null values. The instructions you are giving me if I am not
wrong works for one field only. Is there anything that I can do to
specify more than one? is there any code available?
 
S

Steve Schapel

Jrmrcol,

Use the Nz() function.

1. Make sure you have a backup of your database.
2. Make a query in design view, based on your table.
3. Add each field that this null problem applies to into the query
design grid.
4. Make it an Update Query (select Update from the Query menu).
5. In the Update To row of each column, enter the equivalent of this:
Nz([NameOfThe Field],0)
6. Run the query.
 

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