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 |
|
rowter
Yak Posting Veteran
76 Posts |
Posted - 2009-11-30 : 11:00:23
|
| Hi,I need to display the first name, last name and MI together as fullname. Not all the names have Middle Initials.I am using this query to get all the names without MI.Select Lastnm + ' ' + FirstNm as fullname from clientsIf i include MI i am able to see only names which have MI . Is there any query which displays the names whether or not the MI exists?Select Lastnm + ' ' + FirstNm + ' ' + MI as fullname from clientsThanks in Advance |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-30 : 11:01:46
|
| [code]Select Lastnm + ' ' + FirstNm + coalesce(' ' + MI,'') as fullname from clients[/code] |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
rowter
Yak Posting Veteran
76 Posts |
Posted - 2009-11-30 : 11:24:44
|
| Thanks Visakh16 and tkizer. It worked both ways. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|