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 |
|
aoriju
Posting Yak Master
156 Posts |
Posted - 2011-03-14 : 08:30:30
|
| I have a select statement 00001 + 1I want to remove Prefix zero value |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-03-14 : 08:38:44
|
| You could just convert it. SELECT convert(int,'00001') + 1JimEveryday I learn something that somebody else already knew |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-03-14 : 11:22:57
|
select 00001 + 1 returns 2 MadhivananFailing to plan is Planning to fail |
 |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2011-03-14 : 14:16:37
|
quote: Originally posted by aoriju I have a select statement 00001 + 1I want to remove Prefix zero value
SELECT cast(convert(int,'00001') as varchar) + ' + 1'Use substring and charindex if ur dealing with a column that has this value and has 000 as prefixes. You can use replace if u have 0s only as prefix. |
 |
|
|
|
|
|