?
Solved

How exclude record in query if two fields are null

Posted on 2014-07-28
3
Medium Priority
?
1,048 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
[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
3 Comments
 
LVL 21

Expert Comment

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

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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 35

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

770 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