Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
the below query in sql server

SQL
SELECT 
  a.firstname,
  a.lastname,
  a.surname,
  G.zonename,
  H.name as zonalheadname,
  F.name as regionalheadname,
  I.statusname as zonalheadapprovestatus,
  J.statusname as regionalheadapprovestatus,  
  K.name as zonalheadapprovename,
  L.name as regionalheadapprovename,
  M.farmer_coopname  
FROM dbo.tbl_farmerregistration_ivorycoast A,
  tbl_farmercooperativesmaster_ivorycoast M
  INNER JOIN dbo.tbl_sectionmaster_ivorycoast N ON N.fieldstaffid =  a.createdby
  INNER JOIN dbo.tbl_zonemaster_ivorycoast G ON G.zoneid = N.zoneid  
  INNER JOIN dbo.tbl_registration H ON H.regid = G.zoneheadid  
  INNER JOIN dbo.tbl_registration F ON F.regid = H.regid  
  INNER JOIN dbo.tbl_approvestatusmaster I ON I.approvestatusid = a.firstlevelapprovalstatus  
  INNER JOIN dbo.tbl_approvestatusmaster J ON J.approvestatusid = a.secondlevelapprovalstatus  
  LEFT JOIN dbo.tbl_registration K ON K.regid = a.firstlevelapprovedby  
  LEFT JOIN dbo.tbl_registration L ON L.regid = a.secondlevelapprovedby  
where  
  a.farmerseason = '2019' and  
  a.farmerctscode = '1176795'

when i run the above query in sql server shows error as follows

The multi-part identifier "a.createdby" could not be bound.
The multi-part identifier "a.firstlevelapprovalstatus" could not be bound.
The multi-part identifier "a.secondlevelapprovalstatus" could not be bound.
The multi-part identifier "a.firstlevelapprovedby" could not be bound.
The multi-part identifier "a.secondlevelapprovedby" could not be bound.

what is the mistake in my above sql query. how to solve this error.

What I have tried:

[REMOVE DUPLICATE CONTENT]
Posted
Updated 23-Jul-18 4:17am
v2
Comments
RedDk 23-Jul-18 11:54am    
Huh, that's funny because it worked the other day ...
https://www.codeproject.com/Questions/1252460/Store-procedure-parameter-is-not-working)

1 solution

Check table tbl_farmerregistration_ivorycoast. SQL tells you that is has no those columns you try to reach...
 
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