Extract month from Date field as a number from 1-12

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Using Tap Forms Extract month from Date field as a number from 1-12

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Brendan 2 weeks, 1 day ago.

  • Author
    Posts
  • January 6, 2019 at 8:44 PM #33260

    Ronlangara
    Participant

    Hi
    I am wondering if there is a way to get the month as a number (from 1 to 12) out of the date field.I can get it as a text string ie. January, no problem, but not as 01 as in this example.

    Thanks in advance for any help/suggestions.

    Regards
    Ron

    January 7, 2019 at 12:01 AM #33264

    Brendan
    Keymaster

    Hi Ron,

    Sure. You can add a Calculation field with the following function:

    DATE(Date Field; "MM")

    Tell the formula to return a Text value and it will display 01 – 12 for the month numbers extracted from the Date.

    If you truly want a Number value rather than a Text value that looks like a number, then use the STR2NUM() function to turn the result into an actual numeric value that you can use in other math type functions.

    Thanks,

    Brendan

    • This reply was modified 2 weeks, 1 day ago by  Brendan.

You must be logged in to reply to this topic.