2 Replies Latest reply: May 15, 2014 10:02 AM by JoeMcG _ RSS

    Character Vs Numeric

    JoeMcG _

      Hello friends: I generally like to represent our Branch numbers as a five character text field to enable external lookups where the data is represented that same way. Older (txt) reports however displayed Branch using just three positions.

       

      older    003

      newer  00003

       

      A single trap length of 5 doesn't work with old data. My thought was to format Branch as a Number and create a calc field to convert the number to text with a "00000" format.

      Or can I leave as character and add 2 leading zeroes to old values?

      Obviously not sure how to accomplish either method.

       

      I appreciate the forum! thanks to all who participate.

      Joe

        • Character Vs Numeric
          Data Kruncher

          Hi Joe,

           

          The usual leading zero solution involves a calculated formula with an expression that looks something like this:

          Right("00000"+Branch,5)[/CODE]

           

          Where Branch is your character field. I like to err on the side of caution by including as many zero characters on the left side as the value of the digit on the right.

           

          If you know for sure that you're dealing with a 3 digit (character) number already - in all cases - you could just tack on the leading 2 zeros with:

          "00"+Branch[/CODE]

           

          HTH,

          Kruncher