Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jackstow
Posting Yak Master
160 Posts |
Posted - 2003-06-03 : 11:49:01
|
| In a select statement for a searchcast(Posts.Body as nvarchar(30)) + '...' as Body returns body----Hello guys, is there anybody w...What I want is:body----Hello guys, is there anybody...Anybody got a nice little bit of string manipulation code to find the last blank space and then trim so avoiding trailing letters? ;) |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-06-03 : 12:03:55
|
| OKThere HAS to be a better way that this :select Substring( cast( Posts.Body as nvarchar(30)), 1, 30 - Charindex( ' ', reverse( cast( Posts.Body as nvarchar(30)) ) )) + '...' as Body Damian |
 |
|
|
alemos
Starting Member
16 Posts |
Posted - 2007-12-19 : 08:50:24
|
| There is another way. Read this article:http://www.sqlteam.com/article/returning-complete-words-from-a-substring |
 |
|
|
|
|
|