Parameter Query

G

Guest

I have a report based on "customer" field and a parameter query. How can I
set up the criteria for the parameter query so that if the user enters
"government", it will run a report that includes "federal government," "state
government,", etc. or if they enter "state government" they will only get
the information for "state government" as customer.
 
G

Guest

With the use of a wild card:

If this is your SQL now
Select * From TableName Where customer = [Please select a customer]

Then, with the use of a wild card

==================
Select * From TableName Where customer Like "*" [Please select a customer] &
"*"

Will return all the records that contain the string, any where
====================
==================
Select * From TableName Where customer Like "*" [Please select a customer]

Will return all the records that end with the string
====================
==================
Select * From TableName Where customer Like [Please select a customer] & "*"

Will return all the records that start with the string
====================
 
G

Guest

Thank you, thank you. I tried "Like", "=", and everything else I could think
of but totally forgot about &

Ofer Cohen said:
With the use of a wild card:

If this is your SQL now
Select * From TableName Where customer = [Please select a customer]

Then, with the use of a wild card

==================
Select * From TableName Where customer Like "*" [Please select a customer] &
"*"

Will return all the records that contain the string, any where
====================
==================
Select * From TableName Where customer Like "*" [Please select a customer]

Will return all the records that end with the string
====================
==================
Select * From TableName Where customer Like [Please select a customer] & "*"

Will return all the records that start with the string
====================


--
Good Luck
BS"D


TAWise said:
I have a report based on "customer" field and a parameter query. How can I
set up the criteria for the parameter query so that if the user enters
"government", it will run a report that includes "federal government," "state
government,", etc. or if they enter "state government" they will only get
the information for "state government" as customer.
 

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