parameter queries

S

scottyb121

I am running a report through a query that has three parameters asking for
the insurance, appointment date, and status. You can enter one piece of
information for each box that pops up and the report will show the data that
matches all three criteria. I want to make it so that if you press enter for
one or any of these boxes thus leaving it blank it will show all the data for
that field. For instance pressing enter on the first and third boxes and
typing 12/17/08 on the second will create a report showing all the insurances
and statuses for 12/17/08. I don't know what to type in the criteria for
each of the three fields in my query to make this possible. Thank you for
help.

Scott
 
K

Ken Snell \(MVP\)

SELECT *
FROM TableName
WHERE (Field1 = [Enter first parameter] OR
[Enter first parameter] Is Null) AND
(Field2 = [Enter second parameter] OR
[Enter second parameter] Is Null) AND
(Field3 = [Enter third parameter] OR
[Enter third parameter] Is Null);
 
S

scottyb121

I am a beginner at Access so I don't really know much, but where do I enter
this in my query? Thanks
SELECT *
FROM TableName
WHERE (Field1 = [Enter first parameter] OR
[Enter first parameter] Is Null) AND
(Field2 = [Enter second parameter] OR
[Enter second parameter] Is Null) AND
(Field3 = [Enter third parameter] OR
[Enter third parameter] Is Null);
I am running a report through a query that has three parameters asking for
the insurance, appointment date, and status. You can enter one piece of
[quoted text clipped - 12 lines]
 
K

Ken Snell \(MVP\)

Open the query in design view.

In the WHERE: box under Field1, enter this expression:
[Enter first parameter] OR [Enter first parameter] Is Null

Do the same for the other two fields (using what I provided in the first
reply).

Of course, change the parameter text to be what you want it to be.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


scottyb121 said:
I am a beginner at Access so I don't really know much, but where do I enter
this in my query? Thanks
SELECT *
FROM TableName
WHERE (Field1 = [Enter first parameter] OR
[Enter first parameter] Is Null) AND
(Field2 = [Enter second parameter] OR
[Enter second parameter] Is Null) AND
(Field3 = [Enter third parameter] OR
[Enter third parameter] Is Null);
I am running a report through a query that has three parameters asking
for
the insurance, appointment date, and status. You can enter one piece of
[quoted text clipped - 12 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top