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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Easy displaying text problem

Author  Topic 

sqlchiq
Posting Yak Master

133 Posts

Posted - 2008-08-14 : 15:00:28
if u had "Gaylord Palms Saturday" in a column how would you go about displaying just gaylord palms


im trying to do left(column, len(column)- 'length for saturday')
but i dont know how to do that last 'length for saturday' part

keep in mind that saturday could be wednesday or anyday

is there another way to do it?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-14 : 15:04:22
SELECT REVERSE(SUBSTRING(REVERSE(yourcolumn),CHARINDEX(' ',REVERSE(yourcolumn))+1,LEN(yourcolumn)))
Go to Top of Page

sqlchiq
Posting Yak Master

133 Posts

Posted - 2008-08-14 : 15:30:47
now im trying to display only saturday (or whatever day) in a new calculated field

im trying


select reverse(LEFT(reverse(location), CHARINDEX(' ', reverse(location) - 1)))
from gaylordhotel


but no dice
Go to Top of Page
   

- Advertisement -