Skip to main content

How to Return a 2-Digit Value for Date Formula "Month(date)" and "Day(date)"

Comments

1 comment

  • Permanently deleted user
    Jake Marwil commented  ·    ·  

    Hi John,

    To obtain a result like "2014-01-15", you will need to add some conditionals into your calculation. You could use:

    year({Month Ending}) & "-" & if(month({Month Ending})<10,"0" & month({Month Ending}),month({Month Ending})) & "-" & if(day({Month Ending})<10, "0" & day({Month Ending}), day({Month Ending}))

    This will output the way you are looking for in a calculated text field and will also return a valid date if you are using a calculated date field. Please let us know if you have any further questions.

    Regards,

    Jake

    0

Please sign in to leave a comment.

Powered by Zendesk