0

Hello all,

I'm currently trying to setup a SQL View that's going to be used to pull info from a table and output it onto a label... Long story short the only piece I need help with is having the SQL view remove leading zeros from one column called "Reference". The current data in reference currently looks like "000048212". Of course this needs to happen without affecting the actual table. Also its always 4 leading zeros.

Thanks for any help,
Stephen

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by JoeJonnyBoy75
0

there are other ways you could do this, but here's one

select
CAST(Reference AS INT) as REFERENCE
from tablename
0

there are other ways you could do this, but here's one

select
CAST(Reference AS INT) as REFERENCE
from tablename

Thank you very much, it worked perfectly.

Keep up the good work,
Stephen

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.