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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-04-08 : 08:31:53
|
| Michael writes "I'm new to SQL moving over from Access. I've got a table that contains employees deatils, forename, surname and known_as. What I'd like to do is create a query that shows a column for forname that contains known_as if >0 else forename, and a column that contains full name I've created a query for this already.SELECT *,CASEWHEN LEN(Known_as) = 0 THEN forename + ' ' + surnameELSE Known_as + ' ' + surnameEND AS Namefrom NamesCan this be done" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-04-08 : 09:19:21
|
| yes you can use. Did you run this?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|