Solved

Null Field Equals Zero In Access

Posted on 2007-12-03
4
421 Views
Last Modified: 2012-06-21
I have an Access table with 4 columns  I am using an expression to sum two of the columns to update my totals columns.  However  I need to populate the null fields of one of the columns that is being summed with zero so the math will work.  How can that be done?  Thanks.
0
Comment
Question by:submarinerssbn731
  • 2
4 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 50 total points
ID: 20396328
Nz(YourColumnNameGoesHere, 0) will convert any null values to zero.

0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20396345
SELECT Nz(Field1,0), Nz(Field2,0), Nz(Field3,0), Nz(Field4,0) FROM tblMyTable;
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20396357
Smile, looks like Jim beat me to the post.
0
 

Author Closing Comment

by:submarinerssbn731
ID: 31412359
It did convert the null fields to zero but the query only returned the records with null fields.  I want to return all rows when I run the query.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question