Solved

How exclude record in query if two fields are null

Posted on 2014-07-28
3
900 Views
Last Modified: 2014-07-28
I have a query that includes to fields, for example...  Date1 and Date2

If either of these date fields have a date in them I want the record to be included in the query result.  But if BOTH of the date fields are null I do not want the record to be included in the result.

How can this be done?
0
Comment
Question by:SteveL13
3 Comments
 
LVL 21

Expert Comment

by:Randy Poole
ID: 40224330
select * from yourtable where not isNull(Date1) or not isNull(Date2)
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40224335
add a Where clause

WHERE ((DATE1 Is Not Null) AND (DATE2 Is Not Null)) OR ((DATE1 Is Not Null)) OR ((DATE2 Is Not Null))
0
 
LVL 32

Expert Comment

by:ste5an
ID: 40224336
Add an appropriate WHERE condition. E.g.
WHERE NOT (IsNull([Date1]) AND IsNull([Date2]))

Open in new window

.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now