473,789 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculating against Nulls in Access Query

Hi all,

In Microsoft Access 2000, how do I tell a query to count a null as zero? I'm
adding several columns of data, and many contain nulls, but that makes my
results be null as well. Is there any simple way to compensate for this? Maybe
at the SQL level?

I run into this often in MS SQL, but I generally use a DTS to create a temp
table and convert all null's to zero... but in this Access database, the data is
linked from a read-only table. Is there some quick/simple way to tell Access to
count null fields as zero?

Thanks,

Alex.
Nov 12 '05 #1
1 1545
NZ()

"Alex" <al**@totallyne rd.com> wrote in message
news:yd******** ************@sy smatrix.net...
Hi all,

In Microsoft Access 2000, how do I tell a query to count a null as zero? I'm adding several columns of data, and many contain nulls, but that makes my
results be null as well. Is there any simple way to compensate for this? Maybe at the SQL level?

I run into this often in MS SQL, but I generally use a DTS to create a temp table and convert all null's to zero... but in this Access database, the data is linked from a read-only table. Is there some quick/simple way to tell Access to count null fields as zero?

Thanks,

Alex.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2398
by: | last post by:
I have an Access database used to track donor pledges. In it, there is a table that contains three fields for each donor: Gift_Amount, Gift_Per_Year, and Matching_Gift_Ratio. The following formula would calculate the total pledge amount for each donor: (Gift_Amount * Gift_Per_Year) * (Matching_Gift_Ratio + 1). A total Pledge for all donors would just sum up the calculated values.
0
1689
by: Amit | last post by:
Hi: I'm trying to manually compute the ISIZE in REORGCHK for indexes in DB2 v8 (fp 4). Based on the documentation in Administrative Guide for v8, for non lob fields ISIZE should be the aggregate of avg datasize of the index columns + 2 bytes (1 byte for v7) overhead for each varchar and vargraphic column and 1 byte overhead for each null column. I use AVGCOLLEN in syscat.columns for the column size, and add 2 bytes
1
2073
by: PST | last post by:
Here's a problem I'm trying to deal with: I'm working on a Frontpage 2000 website for a boat handicapping system, built in Access 97. What I'm trying to accomplish is: The user enters a boat name in a text field OR a sail number in a text field, and gets the desired boat record back (an exact match).
1
1214
by: Alex | last post by:
Hi all, In Microsoft Access 2000, how do I tell a query to count a null as zero? I'm adding several columns of data, and many contain nulls, but that makes my results be null as well. Is there any simple way to compensate for this? Maybe at the SQL level? I run into this often in MS SQL, but I generally use a DTS to create a temp table and convert all null's to zero... but in this Access database, the data is linked from a...
6
5457
by: Cliff72 | last post by:
I need to fill in the nulls in the batch field the value from the record immediately preceding the null one ie replace the nulls with the preceding value until I hit a record with a value in it--then hold the next value through the next set of nulls, and so on. See example below: I wanna copy down batch "IMR138" in record ID 1, all the way to ID 10. Then copy down batch "7138" all the way to ID 20 and so on....
0
1133
by: LoopyNZ | last post by:
I'm sure this has something to do with NULLS, but I just can't get my head around this behaviour. More importantly, I can't SOLVE this behaviour, and until I do I can't have any confidence in my data! - Specs: Access 2007, Windows XP, data in linked (mySQL) table. - I have a text (varchar) field called that contains NULL values. - I have a calculated field to check the
2
2900
by: ManningFan | last post by:
Go into a table where you have a field that has NULL values. Right- Click on a record with a value in that field and choose "Filter Excluding Selection". Some (or most, or all) of your records where there is a NULL value in that field get eliminated. Without getting crazy (i.e. designing your own bottons and "re- inventing the wheel"), is there a way to make Access stop doing this?
1
1524
by: Dennis Hartmann | last post by:
ACC 97 - Report with multiple grouping levels. Report footers have text controls with controlsource: "=Avg()". The report's Recordsource was changed so field1 contains null (instead of zero) for no value, because the avearages were misleading. After that change, the report fails with the following error: "The Microsoft Jet database engine could not execute the SQL statement because it contains a field that has an invalid data type." ...
1
2771
by: babamc4 | last post by:
Hi All, I am trying to run a query to include null fields. My tables are as follows: Table Demographics 54 records (Main table) Table Follow Up During Radiotherapy 100+ records (Sub table) Table Follow Up Post RT 100+ (Sub table) Table Last Contact 54 records (Sub table) All are one to many except for Table Last Contact which is one to one.
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.