|
-
Oct 16th, 2000, 12:30 PM
#1
Thread Starter
Fanatic Member
Hi!
I have name fields in a table
like
Bond James
Want to wipe out James
select name from table where ???????
Any help is appreciated...
-
Oct 16th, 2000, 02:09 PM
#2
Frenzied Member
select name from table where name like "Bond *"
-or-
select name from table where name like "Bond %"
-
Oct 16th, 2000, 03:27 PM
#3
Thread Starter
Fanatic Member
Thanks
The problem was I had to do it on all the names on the table
But the solution I came up with
was
select name = substring(ltrim(name),1,PATINDEX("% %",ltrim(name)))
where patindex("% %",name) > 0
removes text following a space from the name
while ignoring leading spaces (in fact it removes them as well)
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|