473,503 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check on fields without a value (value Is Null)

Dear reader,

I found out a strange behaviour in a query of the type Total (summation
query).

In case of a normal select query with a criteria setting Is Null for
field-A, four (4) records are found.

If I specify in a Total query for the same field Count where Is Null the
result is zero (0) records.

Is that because field-A is a numeric field?

How can I check in a Total (summation) query on fields without a value for
numeric fields?

Thanks for any help.

Kind regards,

Simon van Beek

Jan 30 '06 #1
3 4690
Simon, in your Total query, what is in the Total row under this number field
with the Is Null criteria?

If it says Group By, you are applying the criteria *after* grouping (i.e.
Access puts it in the HAVING clause.) If the total shows a number (even
zero), then the *total* is not Null.

To apply the criteria *before* gouping, drag the field into the design grid
a 2nd time, and use Where in the Total row. Move the criteria here instead
of under the instance of the field where you have Group By. Access puts the
criteria in the WHERE clause, and gives the behavior you expect.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Simon" <S.******@HCCnet.nl> wrote in message
news:43***********************@dreader25.news.xs4a ll.nl...

I found out a strange behaviour in a query of the type Total (summation
query).

In case of a normal select query with a criteria setting Is Null for
field-A, four (4) records are found.

If I specify in a Total query for the same field Count where Is Null the
result is zero (0) records.

Is that because field-A is a numeric field?

How can I check in a Total (summation) query on fields without a value for
numeric fields?

Jan 30 '06 #2
The problem is that Access will not count Null fields. If you put the
criteria under the potentially Null field but count another field, say
an AutoNumber, which can never be Null then the query will work.

MS Access - A legend in it's own time.

*** Sent via Developersdex http://www.developersdex.com ***
Jan 31 '06 #3
Yes, that's right. Any database worth using only counts the number of known
values.

The Null values (unknown or not applicable) are not counted, so the database
correctly reports the number of actual values you have in the field, and can
then go on to give correct averages etc.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"steve.minnaar" <st*****@concise.com> wrote in message
news:8o*************@news.uswest.net...
The problem is that Access will not count Null fields. If you put the
criteria under the potentially Null field but count another field, say
an AutoNumber, which can never be Null then the query will work.

MS Access - A legend in it's own time.

Jan 31 '06 #4

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

Similar topics

6
15413
by: pam | last post by:
sorry for my poor english first. $notation=$rs->fields; if(!empty($notation)) echo $notation; the notation field in database is a text type, when the value is null, it will cause a mistake;...
1
45512
by: Luis | last post by:
Is there an easier way to check if any of the fields returned in a select statement have null values? After running this command: set rs = conn.execute("select A,B,C,D,E,F,G,H,I,J from...
1
5295
by: Martin | last post by:
Hello Everybody! I have a POLINE table on a SQL Server 2000 DB. Before I update the record I need to check that either field, STORELOC or WONUM has data on it. If both fields are NULL I would...
2
2278
by: | last post by:
does anyone know what is the maximum number of fields that can be updated at once in access 2000 i am updating approx. 150 at once and keep getting this error: Microsoft JET Database Engine error...
5
24596
by: Krechting | last post by:
Hi ALl, I have a code that checks if the documents in a hyperlink field are still where they should be. I use fileexist(). First I want to filter out all the hyperlink fields that are empty. I...
3
1900
by: MLH | last post by:
I have a query, qryAppend30DayOld260ies that attempts to append records to tblCorrespondence. When run, it can result in any of the following: appending no records, appending 1 record or appending...
4
3794
by: Larry | last post by:
OK, I'm just learning MySQL, or at least trying to. I have a table with data as follows USER FIELDID VALUE 1 1 Bob 1 2 Smith 2 1 John 2 ...
14
2331
by: Ørjan Langbakk | last post by:
I have a form where the user has the possibility to enclose his name. email, address and phonenumber. I want to be able to check if some of the fields are filled - at least one. This is so that...
4
4006
rsrinivasan
by: rsrinivasan | last post by:
Hi all, I have one table with 24 fields in SQL server. In this some of the fields has NULL value. But i want to get the records which does not have any NULL value in any one of the fields....
0
7205
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,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
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,...
1
7011
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...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4689
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...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.