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

    3 Letter Month Name

    Nick Osdale-Popa

      I thought we had covered this, but couldn't find anything in the archives.

       

      For a date field, I'd like a text field that displays the Month Name (Jan, Feb, etc).

       

      The best I could come up with is as such:

      [font="courier"]IF(Month(resultDate) = 1, "Jan","")+

      IF(Month(resultDate) = 2, "Feb","")+

      IF(Month(resultDate) = 3, "Mar","")+

      IF(Month(resultDate) = 4, "Apr","")+

      IF(Month(resultDate) = 5, "May","")+

      IF(Month(resultDate) = 6, "Jun","")+

      IF(Month(resultDate) = 7, "Jul","")+

      IF(Month(resultDate) = 8, "Aug","")+

      IF(Month(resultDate) = 9, "Sep","")+

      IF(Month(resultDate) =10, "Oct","")+

      IF(Month(resultDate) =11, "Nov","")+

      IF(Month(resultDate) =12, "Dec","")[/font][/quote](This was the easy way, so that I didn't have to worry about all those ending ")"'s)

       

      As my old Marine Captain used to say:

      ITABWODI =

      Is There A Better Way Of Doing It?

        • 3 Letter Month Name
          Grant Perkins

          Lookup table?

           

          Fixed values so a standard table would be transportable between models - perfect task for WorkStore.

           

          But I do like your formula.

           

          Which to use might be influenced by circumstances.

           

           

          Grant

           

           

          Originally posted by Nick Osdale-Popa:

          I thought we had covered this, but couldn't find anything in the archives.

           

          For a date field, I'd like a text field that displays the Month Name (Jan, Feb, etc).

           

          The best I could come up with is as such:

          [font="courier"]IF(Month(resultDate) = 1, "Jan","")+

          IF(Month(resultDate) = 2, "Feb","")+

          IF(Month(resultDate) = 3, "Mar","")+

          IF(Month(resultDate) = 4, "Apr","")+

          IF(Month(resultDate) = 5, "May","")+

          IF(Month(resultDate) = 6, "Jun","")+

          IF(Month(resultDate) = 7, "Jul","")+

          IF(Month(resultDate) = 8, "Aug","")+

          IF(Month(resultDate) = 9, "Sep","")+

          IF(Month(resultDate) =10, "Oct","")+

          IF(Month(resultDate) =11, "Nov","")+

          IF(Month(resultDate) =12, "Dec","")[/font][/quote](This was the easy way, so that I didn't have to worry about all those ending ")"'s)

           

          As my old Marine Captain used to say:

          ITABWODI =

          Is There A Better Way Of Doing It? /b[/quote]

          • 3 Letter Month Name
            Bruce _

            I have always used an internal lookup table for this. Was a look quicker to type 12-3 letter months than a whole formula.

             

            Cheers

              smile.gif[/img]