Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using date range and text Is Null parameters ignoring date range- Help

Status
Not open for further replies.

davide507

MIS
Jun 11, 2007
1
US
Hello,
I've created a select query with a date range parameter as well as a text field parameter

Between [Start Date] and [End Date]

The second parameter:

Like [Enter Accountant] or Like [Enter Accountant] Is Null.

When you run the query, and enter the range and the Accountant's name, it returns the accountants records for the specified date range. When you enter the date range and leave the accountant parameter blank, it returns all records regardless of the date range entered. How do I set this up to deliver all accountants records within the date range if the parameter is blank? Any help would be greatly appreciated!
David
 
I bet in the query grid you have Like [Enter Accountant] and [Enter Accountant] Is Null on different lines. Either duplicate Between [Start Date] and [End Date] on both lines or combine the accounting question onto one line.

Your SQL is (Between [Start Date] and [End Date] AND Like [Enter Accountant]) OR ([Enter Accountant] Is Null), isn't it?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Replace this criteria:
Like [Enter Accountant] or Like [Enter Accountant] Is Null
with this:
Like [Enter Accountant] OR [Enter Accountant] Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top