You could also try using CONTAINS instead of LIKE.  That way you would
retrieve records that contained the phrase.  Might get you a little
closer with a little less pain.

On Thu, 11 Jan 2001 09:48:31 -0600 [EMAIL PROTECTED] writes:
> 
> 
> Hi gang,
> 
> I don't think there is a way to do this, but wanted to give you SQL 
> gurus a shot
> at it.
> 
> I have a table that has department names in it (DeptName) with an 
> autogenerated
> DeptID.  When a user wants to enter a new department name, I want to 
> show him or
> her a list of similar department names to make sure we don't get 
> duplicates
> entered.
> 
> Example:  User wants to enter West Coast and Midwest Marketing.  One 
> entry
> already in the table is West Coast & Midwest Marketing.
> 
> If I use   SELECT DeptName
>      FROM tblDepartments
>      WHERE DeptName LIKE '%NewDeptName%'
> 
> It won't find it.  I know that on this example I could parse through 
> the
> variable and look for &s and then use an OR clause, but this is only 
> one case.
> There could be cases like these:
> 
> Existing Name            Proposed New Name
>
-------------------------------------------------------------------------
----
> Marketing/Support        Marketing - Support
> Midwest Admin            Midwest Administration
> Large Corporate Marketing     Large Corp Marketing
> 
> etc. etc.
> 
> Anyone suggest a "relatively" easy way to look for similar names in 
> the table?
> 
> Thanks,
> 
> Loyd Campbell
> 
> Website Manager
> Bank One International Group
> 1700 Pacific Ave., 21st Floor
> Mail Code TX1-2805
> Dallas, TX 75201
> [EMAIL PROTECTED]
> 214-290-2811 (office)
> 972-567-9082 (cell)
> 
> 
> 
>
-------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield 
> anti-
> spam software. Please contact your email administrator if you have 
> any
> questions about this message. MailShield product info: 
> www.mailshield.com
> 
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to