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

Using Excel values as criteria? 1

Status
Not open for further replies.

Lost500

IS-IT--Management
Joined
Mar 10, 2009
Messages
110
Location
US
Hi All!
I would like to use a list of values from an excel spreadsheet as the criteria for a query... i.e. someone has a list of names and wants a report for those specific people. can i use their spreadsheet or do i have to type in each person's name? Please help!

Thanks
 
thanks leslie
and how does one use the values in a table as criteria? sorry for the ignorance but thanks for the help!
 
sorry i meant how to do that in the query builder?

do you add the table and link it to my real tables and then use the name field from my temp table so that the results will only show linked data from those values? i think thats what your saying right???

is there a way to insert the table values in the criteria field?
thanks for the help!!
 
lets say you have imported the excel list:
[tt]
NamesList

Names
Joe Blow
Jane Doe[/tt]

and in your database you have a table that contains those names (tblEmployees) and you only want to select the names in the list:

Code:
SELECT * FROM TblEmployees where NAME in (SELECT Name FROM NamesList)

or you could do something like:
Code:
SELECT * FROM TblEmployees E Inner Join NamesList L on E.Name = L.Names

HTH

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top