Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

97 Posts

Posted - 03/20/2014 :  21:15:09  Show Profile  Reply with Quote
I would like to find the last 5 characters on a column based upon a join I wrote. when it finds anything that matches the word "color" WHICH is 5 characters long it should rename it to "color". else "b&W". So the table may have a column name "print monitor color" or fax copier.

CASE SUBSTRING(left( , 5) = "color" then "color" else "B&W"))

is this correct

In (Som, Ni, Yak)

17689 Posts

Posted - 03/20/2014 :  23:49:13  Show Profile  Reply with Quote
CASE WHEN RIGHT( , 5) = 'color' then 'color' else 'B&W' END

Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000