Click here to Skip to main content
16,022,536 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends

I am working on a Windows Application. I have made two tables in MS Access file. The first table (tblEmployees) has all the details of Employees. and the second table (tblDesig) has two columns, the first is the Designation and Second is ID. Now, I have almost more than 50 designations and I have given a unique ID to each designation.
For example

Designation--------ID
Manager------------1
Assistant----------2
Accountant---------3
and so on.

I have also a designation field in tblEmployees. I have put the ID in the Designation column of the tblemployees rather than the actual Designation.
Now I have made a Datagridview in my form and I have made 4 columns in Datagridview(Name,Designation,Salary,Address)
I want to fill the datagridview with the employees from tblemployee those have more than 500 salary. Until yet every thing is right. But the problem is that I want that the designation field of datagridview should filled with the Actual Designation (which it takes from the tblDesig on the basis of ID) not the ID.

So, How I can do that? What SQL Query should I Use here?
Can some one help me? Waiting for reply.
Posted
Updated 11-Sep-10 5:27am
v2

HI you can use the SQL INNER JOIN query on the tables tblEmployees and tblDesig with WHERE clause to get the employee whose salray is 500
 
Share this answer
 
Comments
rashidfarooq 12-Sep-10 4:50am    
Brother! It does not work. I have applied. I want to just replace the ID with the Actual Designation which is in the tblDesig.
SELECT a.name, b.designation, a.salary, a.address
FROM tblEmployees a INNER JOIN tblDesig b
ON a.designation = b.id
WHERE a.salary > 500
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900