Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use multiple parameters in a query

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
I am in trouble. How can I use a parameter query with parameters belonging to different fields? i.e how to combine different parameters?
 

I assume you have a query with n number of columns or fields. And that you want to be able to select records based on multiple parameters - each parameter belonging to a different column. If that is the case then you would have a query like one of the following.

SELECT *
FROM tbl
WHERE OrderQty>[Enter Minimum Order Quantity] AND ProjID=[Enter Project ID];

SELECT *
FROM tbl
WHERE (OrderQty Between [Enter Minimum Order Quantity] AND [Enter Maximum Order Quantity]) AND ProjID=[Enter Project ID];

SELECT *
FROM tbl
WHERE Team Like NZ([Enter Team Name],"") & "*" OR TeamID=NZ([Enter Team ID],0)

Hope these samples help you get started. Terry Broadbent
Please review faq183-874.

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top