If what you are trying to  do is eliminate trailing spaces why not just do:

Update contacts set contact = rtrim(ltrim(contact))

 

-----Original Message-----
From: morchella [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 03, 2008 9:03 AM
To: CF-Talk
Subject: sql question: contains space' '

hey guys.
this is a 2 parter.

i have a table i need to fix.  i have no real idea how to do this. the
problem is the Contact filed.

the first several thousand entries combine fnme & lname into this one field
from a xls file.
then maybe 20,000 entries only have a name with a space in the Contact
filed.
then some one caught the error in the xls file & made a tweak to it so the
remainding3k entries are fine again.

so...
Part 1
i need to find out how to do a where statement that looks for a single name
that could be any thing, a null or a single name with a space or any
combinations of space....

like 'Joe ',  'Dan ' but NOT 'James Dean'
right now my select to find the problem isn't really working..

SELECT     rep_assigned, id, industry, Contact, Address, City, State, Zip
FROM        Contacts
WHERE     (Contact LIKE '') OR (Contact LIKE ' ')

Part 2
then i will need to do a find & update from the xls where Contact is a
partial match & Address is a full match.
this is the part that scares the crap out of me!




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295753
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to