>Why I get different sets of records:
>
>Table1 (Name C(40), Key1 N(4), ...)
>Table2 (Text C(60), Key1N(4), ChildKey C(100))
>cChild = "000100050004"+SPACE(88)
>
>1.)
>SELECT Table1.*,Table2.Name AS T2Name FROM Table1 LEFT JOIN Table2 ON Table1.Key1 == Table2.Key1 WHERE Table2.ChildKey <> cChild INTO CURSOR Test
>
>Here I get ALL the records from Table1 but the field T2Name is NULL for those records where Table2.ChildKey <> cChild
>
>
>2.)
>SELECT Table1.*,Table2.Name AS T2Name FROM Table1 LEFT JOIN Table2 ON Table1.Key1 == Table2.Key1 WHERE .NOT. Table2.ChildKey == cChild INTO CURSOR Test
>
>Here I get filtered records from Table1.
>
>Why?
Both should return same filtered records from table1 (no nulls). In VFP6 and prior however nulls would return in both. This was corrected in VFP7.
PS: With == in SQL you don't need to pad or trim variable to match length. ie:
cChild = "000100050004"
cChild1 = "000100050004"+space(88)
where myField == cChild
and :
where myField == cChild1
are same.
Cetin