I have two tables Sales and Return:
Sales table:
DocNum ItemCode
101 itemcode1
101 itemcode2
102 itemcode3
102 itemcode2
Return table:
DocNum ItemCode
101 itemcode1
102-reject itemcode2
Desired output:
DocNum ItemCode
101 itemcode2
102 itemcode3
I need to select data from the Sales table that does not exist in the Return table, using a NOT IN condition. I only get records that match DocNum column on the two tables, my problem here is user put a word 'reject' on the Return table.
Is there a way to to match the docnum column in these situation?