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

Multiple Criteria Query

Status
Not open for further replies.

Basia

Programmer
Apr 27, 2001
64
ML
Greetings. I am trying to do a simple select query and it is driving me nuts.

I have two tables Personnel and Salary.

In PERSONNEL, the grade and step are separate fields. I want to use these two fields to look up the salary for a specific grade and step in the SALARY table.

How do I either write the SQL for a query or use Dlookup?

Any help is appreicated!
Basia
 
Basia,
If I am understanding your problem correctly:

SELECT <Personnel.whatever>, <Salary.whatever>
FROM Personnel INNER JOIN Salary ON (Personnel.grade = Salary.grade) AND (Personnel.step = Salary.step);

Let me know if your problem is more complicated (it sounded like the grade and step *might*??? be in the same field in Salary??

Good Luck,
Paul
 
Hi Paul:

Thanks for responding. I did have the SELECT statement the same as you. Here is my problem:

PERSONNEL Table

PName (i.e. Sam)
PGrade (i.e. A)
PStep (i.e. 1)

SALARY Table

SGrade (i.e. A,B,C)
SStep (i.e. 1,2,3,4,5)
SSalary (i.e. 500, 700, 900)

When I join these tables, I get the following results:

Sam A 1 $500
Sam A 2 $700
Sam A 3 $900

All I want is the first one. Can you help???? It is making me crazy!?!
 
Hi Paul:

Ignore previous message - I got it to work. Thanks again for helping - much appreicatd!

Basia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top