Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wildcard Search on Multiple Values - "Like" statement using a list

Status
Not open for further replies.

minifelt

MIS
Jun 5, 2007
25
US
Hello,
Please give me an idea how I can do a wildcard search on multiple values contained in a specific field.

PROBLEM DESCRIPTION:

We have a CUSTOMER table with 500 customers. Example of table records:

CustID Customer_Name
1 ABC Co.
2 XYZ Co.
3 Acme Co.

We have a POINT OF SALE table that contains various permutations of the customer name. It doesn't match the values in the CUSTOMER table because the data comes from an external source (sales distributors) who don't use the same CUSTOMER table. Example of table records:

Customer_Name Sales_Amount
ABC Company 100.00
A.B.C Co. 50.00
BofA/ABC Company 150.00
XYZ Company 120.00
XYZ Co. 35.00
Cisco c/o XZY Co 200.00
Acme 10.00
Acme Co. 15.00
Acme Company 10.00

I need to assign the correct customer_id on the point of sale table for reporting purposes. Example, all customer names like ABC Co. must have ID=1, like XYZ Co. ID=2 etc, Acme Co ID=3...etc...

Please help me write a query or a procedure that will go through the Point of Sale Table and Lookup the customer ID value of the Customer name.

Thank you much.
 
If you want to get good "fuzzy" matching results, I suggest you look at what 3rd party applications are available. SQL Server has some built-in functions (for example, SOUNDEX), but you will not get as good results as what a dedicated application can produce.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
MiniFelt, people aren't going to do your job for you.

That being said, what do you have so far?

-Sometimes the answer to your question is the hack that works
 
Thank you for the advise. I'll probably go with the 3rd party software.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top