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 |
AndyE
Starting Member
2 Posts |
Posted - 2014-02-25 : 14:48:47
|
Hi, hope someone can help me out here.Could anyone tell me the best way to change an output of P0123 to 123? i.e. drop the letter 'P' and also any leading zeros. We have a report that outputs terminal ID's which range from P0001 through to P0536. I can drop the 'P' easily enough, but being a complete noob with SQL, can't figure out how I can drop the P000 from terminal ID P0001 for example. Any help much appreciated.CheersAndy |
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2014-02-25 : 15:29:17
|
Probably the easiest way is to CAST the value with the P removed to an Integer. |
|
|
AndyE
Starting Member
2 Posts |
Posted - 2014-02-26 : 04:48:29
|
quote: Originally posted by Lamprey Probably the easiest way is to CAST the value with the P removed to an Integer.
Got it, thanks for the pointer |
|
|
|
|
|