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

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

select
CAST(Reference AS INT) as REFERENCE
from tablename

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.