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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2006-10-24 : 09:56:11
|
| How to code to get next letter?For integer, I use i = i+1, how to code in letter sequence?If it is letter "C", I need "D", if it is "M", I need "N" and so on. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-24 : 10:09:37
|
[code]declare @c char(1)select @c = 'C'select char(ascii(@c) + 1)[/code] KH |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-10-24 : 10:50:50
|
Hopefully a translation back to 'a'.declare @test table (ch char)insert @testselect 'A' union allselect 'B' union allselect 'Y' union allselect 'Z'select ch, CHAR(64 + (1 + ascii(ch) % 90) % 64)from @test Peter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-24 : 11:02:44
|
quote: Originally posted by Sun Foster How to code to get next letter?For integer, I use i = i+1, how to code in letter sequence?If it is letter "C", I need "D", if it is "M", I need "N" and so on.
Why do you need this?Can you give us more details?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|