Sybase : How to remove leading zeros from a column?

This is how I do it:

Obviously, the most interesting part for me is the:

construct that finds the position of the first non-ZERO character in the <column> to start substring from.

For detailed info about used functions, please visit Sybase’s documentation:

patindex

char_length

2 thoughts on “Sybase : How to remove leading zeros from a column?

    • Hi Ricky,

      You can use the same query. Give it a try. If it does not work, paste here your test data and I’ll try to help.

      Regards.

Leave a Reply

Your email address will not be published. Required fields are marked *