Solved

Null value in SQL statement

Posted on 2003-10-27
2
228 Views
Last Modified: 2010-05-03
Hi,

please ammend this SQL code to select records if A1 and A2 fields are Null value. I used '' but it doesn't give me correct answer.

"select * From Table1 Where (((Table1.A1) = '')  And ((Table1.A2) = ''))"

Thanx
0
Comment
Question by:ray14
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
j_a_delooze earned 75 total points
ID: 9630187
try:

SELECT * FROM [Table1] WHERE (([Table1].[A1] IS NULL) AND ([Table1].[A2] IS NULL));

-or-

SELECT * FROM [Table1] WHERE (([Table1].[A1] = NULL) AND ([Table1].[A2] = NULL));
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 50 total points
ID: 9630538
j_a_delooze,

If this is MS SQL Server the second solution will not return any values.  Reason: Null <> Null

Anthony
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question