Calculations involving NULL values

vanilladan

Board Regular
Joined
Sep 24, 2002
Messages
145
Hello all,
I wonder if anyone can help.

I have a Database, the information in which is taken from
external reports. The database is therefore "refreshed" on a regular basis.
I run several Select queries to identfy certain records, for instance:

Show records where AVAILABLE STOCK is less than DEMAND.

The problem I have is this:
Many of the records contain NULL values in more than one field.

Where this is the case, ACCESS does not "calculate against" these records.

So, is there a way of saying to Access "treat Null values as Zero"?

If you would like me to give more specific examples, please let me know.
kind regards,

Dan

PS - It may seem like a simple answer to use UPDATE queries to
replace Null values with Zero (which I currently do), but the database is so
large that it takes time to run these queries every time.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
You can do this via a query using an Iif function.
In the column heading write:
Code:
Column_Name:Iif([Your_Column] IS NULL,0,[Your_Column])

What this is doing is saying "If the value in this field IS NULL, return a 0, Else Return the original Value". And just so you know, Iif's are lightning quick in Access, much quicker than the Update Queries would be.
 
Upvote 0
You should also be able to set the defult value of the field to zero... this will allow calculations on your null fields.

Hope this helps.
JT
 
Upvote 0

Forum statistics

Threads
1,221,566
Messages
6,160,525
Members
451,655
Latest member
rugubara

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top