>>I fixed the problem by moving the LEFT OUTER JOIN logic to the WHERE clause, obviously making it an INNER JOIN.
>>
>>Two problems with this approach. 1st, I'm not 100% sure that I don't need the outer join. 2nd, the WHERE clause approach is much slower.
>>
>>Dan
>
>Howsabout posting the posting the SQL? Maybe someone here can help you optimize it.
Ok. Here it is.
CREATE SQL VIEW "VWORKORDHDR_PDATERANGE" ;
AS ;
SELECT Workordhdr.*, ;
Companymstr.ccompanycode, ;
Companymstr.ccompany, ;
Companymstr.ccompdiv ;
FROM ;
wc!WorkOrdhdr, ;
wc!CompanyMstr ;
WHERE ;
Workordhdr.drecdat >= ?pdFrom AND ;
Workordhdr.drecdat <= ?pdTo AND ;
Companymstr.icompanyid = Workordhdr.icompanyid