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 |
|
fmardani
Constraint Violating Yak Guru
433 Posts |
Posted - 2005-08-10 : 08:57:22
|
| Hi,In sql, how do you get the initial of a person?For example:David Charles should give DCJohn Brown Simmons should give JSThanks |
|
|
fmardani
Constraint Violating Yak Guru
433 Posts |
Posted - 2005-08-10 : 09:02:09
|
| It's fine now, i will use substringThanks |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-08-10 : 09:03:24
|
declare @name varchar(20)set @name = 'John Brown Simmons'select left(@name, 1) + Left(right(@name, charindex(' ', reverse(@name))-1), 1)Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-10 : 09:09:33
|
| >>David Charles should give DC John Brown Simmons should give JSYou have to define how you are going to get thisFor two part names First Letter of each nameFor three part names First Letter of First and third nameDo you follow this logic?MadhivananFailing to plan is Planning to fail |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-08-10 : 09:49:12
|
well brett...your initial then would be MD... doh... Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-10 : 09:56:04
|
so first of first and last? MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|