Return Criteria or Return all

halem2

Registered User.
Local time
Today, 16:02
Joined
Nov 8, 2006
Messages
180
Hi:

Using MS Access 2000.

Maybe I've been looking at the monitor for too long but... I need to have a query return data based on a date field or return all dates greater than 1/1/2001 if left blank.

criteria: [Enter date - mm/dd] Or >#1/1/2001#

When I leave it blank it gives me all dates as it's supposed to but when I type a date it does not filter by that date, I still get everything.

I also tried [Enter date - mm/dd] Or Like "*" but it behaves the same way. I know it has got to be easy but my skull may be too thick to let me see it.

Any help is appreciated.
:confused:
 
got it...thanks to

http://www.databasedev.co.uk/blank_query_parameter.html

:D
 
Glad you got it sorted.
 
Using two columns and two criteria rows in the query grid (as in the above link) for one field makes it very difficult to add criteria for other fields.


See Jon K's basic criteria format and his discussion in Note 1 in this thread:-
http://www.access-programmers.co.uk/forums/showthread.php?t=103312


Note:
For criteria that are not based on a form, we can use a parameter such as
[Enter A Region Or Leave Blank To Display All] to replace Jon's form parameter [Forms]![FormName]![ControlName]

^
 
Last edited:
thanks EMP that's a very interesting query and I can learn much from it. Thanks!
:D
 

Users who are viewing this thread

Back
Top Bottom