473,467 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is Null across multiple fields?

76 New Member
Hey there...
I've a simple db and need to run a query to check for is null on multiple fields.

Basically I need to include in my report the record if any of these fields are "is null" age, gender, eye, hair


This code only returns value if all criteria are null. I need to check any field for null.

Expand|Select|Wrap|Line Numbers
  1. SELECT tblMain.uid, tblMain.age, tblMain.gender, tblMain.hair, tblMain.eye
  2. FROM tblMain
  3. WHERE (((tblMain.age) Is Null) AND ((tblMain.gender) Is Null) AND ((tblMain.hair) Is Null) AND ((tblMain.eye) Is Null));
  4.  
Feb 14 '11 #1
3 5985
beacon
579 Contributor
Hi artemetis,

Try changing the AND in your WHERE clause to OR. By using AND, your query is looking for the conditions of ALL to be met. If you use OR, the query will only look for ONE OR MORE conditions to be met.
Feb 14 '11 #2
artemetis
76 New Member
Geez...I tried that and at first it didn't work...now it is working. Oh well.

Thanks for the support!
Feb 14 '11 #3
beacon
579 Contributor
Happy to help...
Feb 14 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: gregory.sharrow | last post by:
I need to secure a datawarehouse table at the row level based on 1 to many keys on that table. A user should only see the rows they have access to. I need to be able to figure out which rows they...
1
by: Chris Wolfe | last post by:
I have two fields that draw their combobox values from the same table. LogBook04.Insurance is the Primary Insurance and LogBook04.SecIns is the Secondary Insurance. Both draw their values from...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
0
by: midnight_use_only | last post by:
although i don't think this is do-able using SQL, i would ask and maybe an expert can help me out. assum i have the following table: Date Code Count 2006-06-06 abc 1234...
3
by: mkjets | last post by:
I have worked for hours on trying to find a solution and have not figured it out. I am working in Access 2003. I need to create a query that takes values from 1 table and displays them in...
2
by: David Ziger | last post by:
With mysql 4.1.11, is there a way to compile the averages and standard deviations across multiple fields? Field1 Field2 Field3 Want to be able to create a new column: SELECT t.Field1,...
4
by: Mike | last post by:
Class A public objX I want to create 2 or more instances of Class A and have the same value for objX in all instances. Instance1 of Class A Instance2 of Class A Instance3 of Class A
2
by: ReneHernandez | last post by:
Good afternoon, I am trying to calculate an average over multiple fields. I've tried using the following =Avg(IIF( = "NA",Null, Val())) + Avg(IIF( = "NA",Null, Val())) + Avg(IIF( = "NA",Null,...
2
by: aruna.mysore | last post by:
Hi all, I have specific question about usage of extern. I want to share a single variable say int a; across multiple files. I would define it in file1.c as int a=0; int main() {
2
by: abirch | last post by:
Hey. So the problem that I'm running into involves auto-numbering invoice numbers. My boss has 3 tables, 2 of which are only to temporarily store information, but when she goes to create a new...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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
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 ...

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.