>
You are joining dbo.INV1 twice so you have to give different alias names for them. For example you can do it like this:
dbo.INV1 as Inv1_Doc ON dbo.OINV.DocEntry = Inv1_Doc .DocEntry LEFT OUTER JOIN
dbo.INV1 as Inv1_Base ON dbo.ODLN.DocEntry = Inv1_Base .BaseEntry
Now you have use that aliases in your select list and WHERE-clause instead of dbo.INV1 ...



