Re: Parameter Query help
From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: Sun, 22 Aug 2004 06:51:38 -0400
After each reference to a parameter in your WHERE clause, add "OR
[Parameter] IS NULL"
You'll also need to use Parentheses to ensure that the boolean operations
are done correctly.
In other words, if you've got:
WHERE Field1 = [Parameter 1]
AND Field2 = [Parameter 2]
WHERE (Field1 = [Parameter 1] OR [Parameter 1] IS NULL)
AND (Field2 = [Parameter 2] OR [Parameter 2] IS NULL)
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tom" <email@example.com> wrote in message news:firstname.lastname@example.org... > Hello > > Ive got a query where the contents are sorted by 3 paramter queries. > > The first is on the client type field. It can either be yes or no, or leave > it blank to get see all records. This is using Is Null > > The Second and Third parameters are a between date and date. Ive also added > the Is Null part to the end so that all records can be seen if they are left > blank. > > The problem im having is that when one of the queries is left blank, i dont > get any results for the query at all. Wheras if i enter values into each > query it works fine, and if i leave them all blank it works fine. > > Thankyou for any help > >