WHERE statement (between) in a query

bignate

Registered User.
Local time
Today, 15:35
Joined
Aug 28, 2013
Messages
34
I use this
'WHERE ((OperationalRiskEventTable.DateReported)>=Forms!U pdateForm!UDateBegin And (OperationalRiskEventTable.DateReported)<=Forms!UpdateForm!UDateEnd)'
in a query by form.
The problem is that you have to enter a date in the between values for results to show. If I don't enter information into a different field such as Full Name but I enter in 40 into Age then everyone that is 40 years old will show. On the other hand if I enter 40 into the Age field but I leave the Date Reported fields empty then no results will show.

How can I change it so that I don't have to enter dates into the date reported fields for results to show?

Thanks
 
I do not understand your post, where does the Age field come into this?

However I suspect that you are going to need some OR criteria checking for Null

Brian
 
I don't understand your post either. However, f you don't want to have to enter dates, then remove the date constraint from your WHERE clause.

But, I'm thinking there is more to your question/post that we are missing.
 
Nate,

Try:

Code:
WHERE (OperationalRiskEventTable.DateReported >= Forms!UpdateForm!UDateBegin Or
       Forms!UpdateForm!UDateBegin Is Null) And 
      (OperationalRiskEventTable.DateReported <= Forms!UpdateForm!UDateEnd Or
       Forms!UpdateForm!UDateEnd Is Null)

Wayne
 
Thank Wayne that was what I needed and thank you brian and jdraw fr trying to help solve my problem.
 

Users who are viewing this thread

Back
Top Bottom