Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 457
  • Last Modified:

Null Field Equals Zero In Access

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
Steve Eckerman
Asked:
Steve Eckerman
  • 2
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Nz(YourColumnNameGoesHere, 0) will convert any null values to zero.

0
 
Rick_RickardsCommented:
SELECT Nz(Field1,0), Nz(Field2,0), Nz(Field3,0), Nz(Field4,0) FROM tblMyTable;
0
 
Rick_RickardsCommented:
Smile, looks like Jim beat me to the post.
0
 
Steve EckermanSystems AdministratorAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now