Example:
select
pl.PONo as PONo,
coalesce(p.LotNo, '????') as LotNo,
pl.GrowerCode as GrowerCode,
pl.ItemCode as ItemCode,
coalesce(pl.Description, i.Description) as ItemDescr,
coalesce(pl.ShortDescription, i.ShortDescription) as
ItemShortDescr,
pl.ProductType as ProductType,
pt.ShortDescription as ProductTypeDescr,
pl.FlowerType as FlowerType,
ft.ShortDescription as FlowerTypeDescr,
pl.GradeCode as GradeCode,
g.Description as GradeDescr,
pl.Label as Label,
pl.Units as Units,
pl.Boxes as Boxes
from POLines pl
left join POs p on ((p.CompanyCode = '9999') and (p.No
= pl.PONo))
left join Items i on ((i.CompanyCode = '9999') and
(i.Code = pl.ItemCode))
left join ProductTypes pt on ((pt.CompanyCode = '9999')
and (pt.Code =
pl.ProductType))
left join FlowerTypes ft on ((ft.CompanyCode = '9999')
and (ft.Code =
pl.FlowerType))
left join Grades g on ((g.CompanyCode = '9999') and
(g.FlowerType =
ft.FlowerType) and (g.Code = pl.GradeCode))
where (pl.CompanyCode = '9999')
and (pl.PONo = '0000000001')
I get:
FlashFiler: Query624155046: Query execution failed:
Assertion failure (d:\opensource\ff2\source\ffsqldef.pas,
line 8223)
[$D538/54584]
The offending field here is ft.FlowerType in the join
clause (should have been ft.Code) I think that this
should have been an exception because the field isn't
part of the ft (FlowerTypes) table
Bert.