Hi ALL
I have a query which loads a value on gate pass no entered in GRPO.
Select Case when pdn1.itemcode='RA0001' then (SELECT DATA FROM A TABLE A)
when pdn1.itemcode='CN0002' then (SELECT DATA FROM A TABLE B) end
from pdn1 t0,opdn t1 where t0.docentry=t1.docentry and U_GP=$[OPDN.U_GP]
I am getting this error
1). [Microsoft][SQL Server Native Client 11.0][SQL Server]The multi-part identifier "pdn1.itemcode" could not be bound. 2). [Microsoft][SQL Server Native Client 11.0][SQL Server]The multi-part identifier "pdn1.itemcode" could not be bound. 3). [Microsoft][SQL Server Native Client 11.0][SQL Server]The multi-part identifier "opdn.u_gp" could not be bound. 4). [Microsoft][SQL Server Native Client 11.0][SQL Server]Statement 'Blanket Agreement' (OOAT) (s) could not be prepared.
Original qry
SELECT case when pdn1.itemcode='RA0001' then (Select (COALESCE( U_WGH,0)-(COALESCE(u_FGBAGS,0)+COALESCE(U_EGBAGS,0)+COALESCE(U_Party,0)))/1000 from [@I_UNLOAD] where U_GP= T0.[U_GP] ) when pdn1.itemcode='CN0002' then (Select COALESCE(U_Diff,0) from [@I_WGHBRG] where U_GP= T0.[U_GP] ) end from pdn1 t0,opdn t1 where t0.docentry=t1.docentry and U_GP=$[OPDN.U_GP]
THanks and regards
Sheetal