Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blanks fields to zeros???

Status
Not open for further replies.

PQTIII

IS-IT--Management
Sep 21, 2004
110
0
0
I added a number field to a record , but it shows blanks in the table for the old records. Is there a way to convert all of those blank fields to show 0 without putting a zero in each field by hand?

Thanks
pt
 
Create an Update query on that field. In the Update To row, under the field, put:

IIf([total] Is Null,0,[total])

Substitute [total] for your field name.
 
SQL code:
UPDATE yourTable SET [your number field]=0 WHERE [your number field] Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Where and how do you do the update code?

Thanks
pt
 
I've never done an update before! If have table 'SurveyPoints' and want to update the field [elevation] that contain nulls with zero. How would I write that statement?

Thanks
pt
 
UPDATE SurveyPoints SET [elevation]=0 WHERE [elevation] Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
worked perfect!!!

Thanks
pt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top