Group:  Microsoft Access ยป microsoft.public.access.queries
Thread: parameter queries

Geek News

parameter queries
"scottyb121" <u48531[ at ]uwe> 12/31/2008 3:48:59 PM
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

Re: parameter queries
"Ken Snell \(MVP\)" <kthsneisllis9[ at ]ncoomcastt.renaetl> 12/31/2008 3:57:38 PM
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);

--

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


"scottyb121" <u48531[ at ]uwe> wrote in message news:8f7d97f6f1029[ at ]uwe...
[Quoted Text]
>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
>


Re: parameter queries
"scottyb121" <u48531[ at ]uwe> 12/31/2008 4:09:10 PM
I am a beginner at Access so I don't really know much, but where do I enter
this in my query? Thanks

Ken Snell (MVP) wrote:
[Quoted Text]
>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]
>>
>> Scott

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net