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 |
|
raoool
Starting Member
3 Posts |
Posted - 2006-03-27 : 10:13:32
|
| Need to generate a single text value 'FullName' by combining first name, middle initial, last name. Below works but if there's no middle initial, generates two spaces between first name and last name. How could this be rewritten to suppress the extra space when no middle initial exists (trim the MI + space) from the result.Select IsNull(Fname, '') + ' ' + IsNull(MI, '') + ' ' + IsNull(Lname, '') As FullName,Address1,Address2From Details Where PID='<<Subject>>'Thanks in advance! |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-03-27 : 10:15:02
|
| Select IsNull(Fname + ' ', '')+ IsNull(MI + ' ', '')+ IsNull(Lname, '') As FullName,Address1,Address2From Details Where PID='<<Subject>>'==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
raoool
Starting Member
3 Posts |
Posted - 2006-03-27 : 17:41:08
|
| Thank you!(Monday morning can't see the 's thru the ('s) |
 |
|
|
|
|
|