I have created a stored procedure in SQL2000 like this :
p.Supp_code + ' : '+ s.Sname as Supp_Nme,p.po_total,r.RC_code,r.Amount
FROM PO_list p inner join RC_list r on r.PO_code = p.PO_code
inner join Supplier s on s.supp_code = p.supp_code
WHERE (p.Supp_code in ('102200','102083')) and (substring(p.PO_CODE ,5,1) = 'R' ) and
(p.cancel = 'N' and r.cancel = 'N' ) and (r.RC_code not IN
(Select v.RC_code From iv_detail v
Where (v.rc_CODE = r.rc_code) and i.iv_code = v.iv_code and i.Cancel = 'N' )
I wonder why the cancel data in iv_List Table not showed in this query. What wrong with this.Please advice.
This query want the data not exists in IV_List Table or exits in IV_List Table and fields Cancel = 'Y'