Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select FileData,FileDataType, ComNo,ComCat,CompSubCat2,' <font color="#000000">' + Whom+ '<br>   <font color="#0099cc"> '+ HouseNo + '<br>'+Locality +'<br>  <font color="#000000">'+MobNo as name1,Complaint,Comment,grivtime,TimeStamp,action,EmployeeList.Name+'('+EmployeeList.Designation+')' as Forward_Name,comp_Solved.Name+'('+comp_Solved.Designation+')' as Officer, ActionFrom from comp_Solved left join EmployeeList on comp_Solved.[from] = EmployeeList.ID where  comNo='mcc/2016/7457' order by TimeStamp asc</font></font></font>



Dear sir,

This my query from view comp_Solved. column name 'ActionFrom' int datatype. In ActionFrom column insert employee Id. i want employee Name instead of ActionFrom Id through by any join apply.

What I have tried:

i want employee Name instead of ActionFrom Id through by any join apply.
Posted
Updated 30-Nov-16 20:07pm

1 solution

I'll simplify this a little:
You have two tables: comp_solved and EmployeeList and you need to get information from comp_solved plus the employee name from the related EmployeeList.
So try the basics first:
SQL
SELECT c.ComNo, e.EmployeeName 
FROM comp_solved c
JOIN EmployeeList e ON c.[From] = e.ID

Run that, and you will get each ComNo with it's related EmployeeName.

Feed that back into your query, and it should be pretty obvious what you need to do
 
Share this answer
 
Comments
Nishant.Chauhan80 1-Dec-16 2:35am    
Thanks its work....
OriginalGriff 1-Dec-16 3:12am    
You're welcome!

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