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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple queries 1

Status
Not open for further replies.

kennetha

Programmer
Sep 10, 2003
105
MT
I have created a query but I need to enter multiple criteria. I used "Between and " but it's not always usefull. I would like to enter for example 112,113,116,117 & 120.
Can someone help please
Thanks
Kenneth.
 
Have a look at the IN. E.g.
Code:
SELECT * 
FROM YOURTABLE 
WHERE NAME [red]IN[/red] ('Andrew','John','Steve')

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Have a look at IN. E.g.
Code:
SELECT * 
FROM YOURTABLE 
WHERE NAME [red]IN[/red] ('Andrew','John','Steve')

Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Oops. Sorry for the double post. Hit submit by accident.

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Can I enter data in a table and ref to it instead of SELECT *
FROM YOURTABLE
WHERE NAME IN ('Andrew','John','Steve')

Thanks Kenneth
 
If you wish to do it like that it might be easier to use:
Code:
SELECT YOURTABLE.NAME
FROM YOURTABLE,YOURTABLE_OF_NAMES
WHERE YOURTABLE.NAME = YOURTABLE_OF_NAMES.NAMES
Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top