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 |
|
phoenixseetha
Starting Member
1 Post |
Posted - 2008-03-31 : 05:54:47
|
| Hi i want to split the numbers from the varchar field(accc0001).i want 0001 only. at the same time select max of that number+1.friends can u help me on this . |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-31 : 05:58:52
|
| [code]Select 'accc' + right('000' + cast(max(cast(Right(col, 4) as int))+1 as varchar(4)),4)from table[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|