By Richard Rost 3 years ago
Use the NZ Function to Convert NULL to Zero
In this Microsoft Access tutorial, I'll show you how to use the NZ function to change NULL values into ZERO, or any other value that you want.
Bill asks: "In my form, I have to add two values together to get a total time an employee worked on a project. I have the default value set to zero, but if they somehow delete the value it messes up my calculations. Is there any way to stop this?"
I'll show you how to set the default country to "United States" if the customer doesn’t have a country specified. If the customer doesn’t have a start date, use NZ to set it equal to today so they don’t get a gift card reserved for long-time customers. If a customer doesn’t have any orders in the database, use a LEFT JOIN to show them in a query and then NZ to set their order total to $0. Check to see if a customer's email address exists in the database. If so, warn before adding. Use NZ to make DLookup not error out.
Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the database template from class plus get access to the Code Vault. If you signed up on YouTube you have to register on my YouTube Find User page so I can set up your account here on my web site. If you're not a member, Join Today!
Subscribe to NZ Function
Get notifications when this page is updated