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

Simply Query Help

Status
Not open for further replies.

corbitt

MIS
Feb 22, 2002
73
0
0
US
I have a simple Access DB, and I need to query two fields from a table (FirstName & LastName).

How do I build a query to return email address for certain first names and last names? I know how to create a query (in Criteria) to return all "Mueller" & "Smith" (LastName), but I don't know how to return only "Robert" "Mueller" & "Rebecca" "Smith"

Thank you,

Jeremy
 
If you want to put the names in the Criteria fields, try this:

SELECT tblName.FirstName, tblName.LastName
FROM tblName
WHERE (((tblName.FirstName)="robert") AND ((tblName.LastName)="mueller"))
OR (((tblName.FirstName)="rebecca") AND ((tblName.LastName)="smith"));

If you want to enter the parameter values when you run the query (for only one person at a time) try this:

SELECT tblName.FirstName, tblName.LastName
FROM tblName
WHERE ((([Enter First Name])=[tblName]![FirstName]) AND (([Enter Last Name])=[tblName]![LastName]));

HTH

John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top