Null values

  • Thread starter Thread starter Jrmrcol
  • Start date Start date
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.
 
Use this replacing your tablble and field names.
UPDATE YourTable SET YourTable.YourField = 0
WHERE (((YourTable.YourField) Is Null));
 
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?
 
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.
 
Back
Top