General discussion
June 14, 2002 at 04:13 AM
bmckeehan

Searching Similar Data in a Field

by bmckeehan . Updated 24 years ago

I need to search a field in a table for records with similar values. For example, an invoice number, “123”, may also appear as “0123”. Here is the query I wrote, which doesn’t give me any results. I even created a record that looks like the example. Any suggestions.

SELECT *
FROM dbo.tbl_cds_paid
WHERE (inv_no LIKE ‘%’ + rtrim([inv_no])) and inv_no <> inv_no

This discussion is locked

All Comments