Dear All,I have the following query select invoicenum,client_no,name_client,debtor_no,name_debtor,doc_no,doc_date,due_date,doc_amount,doc_bal,doctype from opditminner join tempmatchtable on opditm.doc_no like '%' + invoicenum + '%'inner join client on opditm.client_no=client.code_clientinner join debtor on opditm.debtor_no=debtor.code_debtorwhere exists( select invoicenum,rem_amount,rem_date from tempmatchtablewhere id like 'HSS%' and opditm.doc_no like '%' + invoicenum + '%' and rem_amount=opditm.doc_bal and opditm.doc_bal = opditm.doc_amount and opditm.doctype in (1,21) and opditm.apwhst<>21 and opditm.client_no=343)
which will compare the information of table "tempmatchtable" to table "opditm" and will return all that exists in both.The invoicenum may be in the form "A123456" or "1234567".The problem:-when i run the above query with invoices 13,3,1. I get the same information thrice.Please advice on how to cater for this type of problem.Regards,Dwij