Link to home
Create AccountLog in
Avatar of vsllc
vsllc

asked on

Parameter query to pull all data if no value entered.

Using Access 2002, I have a table with a date field.  I want to setup a paramter query that will either pull data as of a certain date entered or pull all data if no date is entered.  I can get the first part, but when no value is keyed I get no results.  How can I do this?
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Example:

SELECT Table1.*
FROM Table1
WHERE (((Table1.NotifyByDate)=IIf(IsNull([Enter Date]),[NotifyByDate],[Enter Date])));


mx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of vsllc
vsllc

ASKER

Works!  Thanks.