Skip to Content
0
Former Member
Feb 13, 2012 at 09:49 PM

Query to find duplicate referance numbers

182 Views

Dear,

We have somehow managed to create the same sales order twice or more. In the field "Customer Ref. No." we always type in BP's ref. no. So what I need is a query which will show me all open sales orders which have more than one identical "Customer Ref. No." (ORDR.NumAtCard)

So what I got so far is:

SELECT T0.[DocNum], T0.[NumAtCard] FROM ORDR T0 WHERE T0.[DocStatus] <> 'C' AND ????

Hope anyone can help. Thanks.

BR

Kjetil Sandvik