2 Replies Latest reply: May 15, 2014 9:53 AM by Ladybugdd77 _ RSS

    Concatenate Text to a Numeric Field

    Ladybugdd77 _

      I'm using Monarch Pro 8.01 and I have a numeric field containing 4 digits in each row.  Is there a way to add a letter to the beginning of this 4 digit number as Excel does with the Concatenate function =concatenate("C",[CODE])?

       

      i.e.  CODE:       NEWCODE:

            1010        C1010

            1012        C1012

            1550        C1550

       

      Thank you!

        • Concatenate Text to a Numeric Field
          Grant Perkins

          Originally posted by Ladybugdd77:

          I'm using Monarch Pro 8.01 and I have a numeric field containing 4 digits in each row.  Is there a way to add a letter to the beginning of this 4 digit number as Excel does with the Concatenate function =concatenate("C",CODE)?

           

          i.e.  CODE:       NEWCODE:

                1010        C1010

                1012        C1012

                1550        C1550

           

          Thank you! [/b][/quote]Yep!

           

          Create a calculated field called Newcode (or whatever you want to call it), which will be a CHARACTER field (it cannot be a numeric field)  and use this formula;

           

          [font="courier"]"C"+Str(Code)[/font][/quote]If by any chance your 4 digit string is in a larger field you may need to TRIM leading spaces.

          [font="courier"]"C"+ltrim(Str(Code))[/font][/quote]should do it.

           

          HTH.

           

           

          Grant

          • Concatenate Text to a Numeric Field
            Ladybugdd77 _

            Thanks Grant first for the help and second for the quick reply!  It worked perfectly!

             

            Take Care!