>The below works:
>
>
>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
> WHERE !EMPTY(lcontrol.cn_name) .and. lcontrol.cn_name IN ;
> (SELECT ctrlname FROM ctrlset WHERE ctrlset.printform = .T.);
> INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
>
>
>so does the reverse:
>
>
>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
> WHERE !EMPTY(lcontrol.cn_name) .and. lcontrol.cn_name IN ;
> (SELECT ctrlname FROM ctrlset WHERE ctrlset.printform = .F.);
> INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
>
>
>However, the reverse of the first using NOT does not work, any idea why anyone?
>
>
>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
> WHERE !EMPTY(lcontrol.cn_name) .and. lcontrol.cn_name NOT IN ;
> (SELECT ctrlname FROM ctrlset WHERE ctrlset.printform = .T.);
> INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
>
>
>The 2nd two statements should produce the same results, but they do not. What is wrong with the "not in" portion?
It seems to me they should produce different results. You can have different subsets of data for .T. and .F.; IN and NOT IN would work on the corresponding subsets, which may, or may not, be related. I suggest you experiment on paper, with some sample data, to see whether you get the same results or not.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)