LIKE query missing results
See also http://tek-tips.com/viewthread.cfm?qid=1572324&page=1Premature optimization is the root of all evil in programming. Donald Knuth, repeating C. A. R. Hoare My blog
View ArticleLIKE query missing results
You can user the space functionUPDATE Table SET Name = REPLACE(Name,SPACE(2),SPACE(1)) WHERE CHARINDEX(SPACE(2),Name) > 0Abdallah, PMP, MCTS
View ArticleLIKE query missing results
WHILE 1=1BEGIN UPDATE MyTable SET MyColumn=REPLACE(MyColumn,SPACE(2),SPACE(1)) WHERE CHARINDEX(SPACE(2),MyColumn)>0 IF @@ROWCOUNT=0 BREAKENDThe reason for the loop is that some of them might...
View ArticleLIKE query missing results
No, most of them are different, so using hard-coded values is not an option.MT
View ArticleLIKE query missing results
Are they all the same? If yes, you can do the followingUPDATE Table SET Name = 'A & W Restaurants and Crowfoot' --This line doesn't have the extra spaceWHERE Name = 'A & W Restaurants and...
View ArticleLIKE query missing results
Thank you everyone!Does anyone know how I can update the 'Name' column to remove any extra spaces between words? I have several thousand records.MT
View ArticleLIKE query missing results
That still didn't any records EwanAs requested, here is the result when I execute:---------------------------SELECT NameFROM tableNameWHERE NAME LIKE '%' + 'Crowfoot'----------------------------A &...
View ArticleLIKE query missing results
This will probably get you the results (and maybe more):SELECT name FROM tableName WHERE name LIKE '%' + 'and%Crowfoot';Plamen Ratchev
View ArticleLIKE query missing results
As Abdshall said, you have an extra space there between "and" and "Crowfoot".--Brad (My Blog)
View ArticleLIKE query missing results
That still didn't any records EwanAs requested, here is the result when I execute:---------------------------SELECT NameFROM tableNameWHERE NAME LIKE '%' + 'Crowfoot'----------------------------A &...
View ArticleLIKE query missing results
OK. What aboutSELECT *FROM TableNameWHERE NAME like like '%' + 'and_Crowfoot'EwanIf you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the...
View ArticleLIKE query missing results
Copy an paste the record in the table into MS Word or a text editor and count the spaces. Or just copy and paste here and we can test it. Abdallah, PMP, MCTS
View ArticleLIKE query missing results
Thanks for the reply - I tried that and it still didn't return any results... any other ideas?MT
View ArticleLIKE query missing results
Hi dccMikeIt looks like the character between 'and' and 'Crowfoot' is an unprintable character, but not a space.Try thisSELECT *FROM TableNameWHERE NAME like like 'A & W Restaurants...
View ArticleLIKE query missing results
There is probably some extra spacing in your data.Abdallah, PMP, MCTS
View ArticleLIKE query missing results
I am testing some searches on a database - I have a record with the following value in the Name field:'A & W Restaurants and Crowfoot'When I do this search it does not return any records:SELECT...
View Article
More Pages to Explore .....