1: 2: 3: 4:
ProductData.Tables(0).DefaultView.RowFilter = "'7001' LIKE accountref + '%'" ProductData.Tables(0).DefaultView.Sort = " LEN(accountref) DESC " and the first row returned should give you the best match, if any