Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i tried query to fetch results but when i execute query this shows me following error

The multi-part identifier "material .MATNO" could not be bound.

The multi-part identifier "plant.plant" could not be bound.

any solution?

What I have tried:

i tried this query
SELECT
customer.custm_no, customer.name,customer.name2,

orderhdr.otype,orderhdr.saleorder,

orderdtl.sitno,orderdtl.qty,

delvdtl.qty,delvdtl.issueqty

material.name,develhdr.nodelv

FROM
customer

left join orderhdr on customer.custm_no = orderhdr.custm_no
left join orderdtl on orderhdr.otype = orderdtl.otype
and orderhdr.SALEORDER = orderdtl.SALEORDER
left join delvdtl on orderdtl.SALEORDER = delvdtl.SALEORDER
AND orderdtl.sitno = delvdtl.sitno
left join develhdr on delvdtl.nodelv = develhdr.nodelv
left join MATMSTA on material.MATNO = MATMSTA.MATNO
left join material on MATMSTA.MATNO = material.MATNO
and MATMSTA.MATNO = material.MATNO
left join plantcocode on plant.plant = plantcocode.plant
left join plant on orderdtl.plant = plantcocode.plant
left join cocode on plantcocode.cocode = cocode.cocode
WHERE
1 = 1
order by
orderdtl.saleorder, orderdtl.sitno
Posted
Updated 28-Mar-16 21:52pm
v2

You are trying to join tables that has not been referenced yet.
When you add left join MATMSTA on material.MATNO = MATMSTA.MATNO there is no reference to material as it's not added until the next row.
Same problem with plant
 
Share this answer
 
It looks like the material table doesn't have a column named MATNO.
Similarly, the plant table doesn't have a column named plant.

Without seeing your schema, all I can suggest is to check your column naming.
 
Share this answer
 
Comments
super_user 29-Mar-16 2:13am    
i check both have columns.. material have matno column and plant have plant column

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