Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Date format MM/YY only

Solved
Jump to Solution
7424 4
cancel
Showing results for 
Search instead for 
Did you mean: 
amymo
5 - Automation Enthusiast
5 - Automation Enthusiast

Is it possible to only have a month and year in the date field. Ex: 07/2021.

One step further, a range of only MM/YYYY-MM/YYYY. Ex: 07/2020-06/2021

1 Solution

Accepted Solutions

Hi @amymo, sorry I just saw your reply.

If you’re still struggling with this, you don’t need DATETIME_FORMAT on the final formula, where you combine the 2 dates. That formula is creating a simple text string, where it combines the text of the the other 2 fields, with “-” in between. So the final result is no longer a date, and using DATETIME_FORMAT on it won’t work. We only need to use it to format the first 2 parts.

It’s possible to simplify this all into a single equation if I knew how the End Date of the range was calculated. But as a simple example, if you had 2 Date selection fields for {Start} and {End}, you could combine it all into:
DATETIME_FORMAT( {Start}, "M/YYYY") & "-" & DATETIME_FORMAT( {End}, "M/YYYY")

Hope that helps.

See Solution in Thread

4 Replies 4
Nick_Dennis
7 - App Architect
7 - App Architect

Yes, you can use DATETIME_FORMAT for this: DATETIME_FORMAT({Date Field},'MM/YYYY')
Just replace {Date Field} with your field. You’ll still need a date field to select a date initially, then the formula will automatically format it to only include Month/Year in a 2nd field.

You could also create a range by creating 3 formula fields: {Start Date} and {End Date} using the DATETIME_FORMAT formula above, then a 3rd formula that combines the newly formatted dates into a string with a dash in between:
{Start Date} & "-" & {End Date}

Here’s the full list of formatting options for DATETIME_FORMAT, which may be useful to some people: Supported format specifiers for DATETIME_FORMAT – Airtable Support

amymo
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks Nick. I got the first two formulas to work but when I try the third which is DATETIME_FORMAT({Project Start Date} & “-” & {Project End Date}) the outcome is this “2009-09-20T00:00:00+00:00”. What am I doing wrong?

Hi @amymo, sorry I just saw your reply.

If you’re still struggling with this, you don’t need DATETIME_FORMAT on the final formula, where you combine the 2 dates. That formula is creating a simple text string, where it combines the text of the the other 2 fields, with “-” in between. So the final result is no longer a date, and using DATETIME_FORMAT on it won’t work. We only need to use it to format the first 2 parts.

It’s possible to simplify this all into a single equation if I knew how the End Date of the range was calculated. But as a simple example, if you had 2 Date selection fields for {Start} and {End}, you could combine it all into:
DATETIME_FORMAT( {Start}, "M/YYYY") & "-" & DATETIME_FORMAT( {End}, "M/YYYY")

Hope that helps.

amymo
5 - Automation Enthusiast
5 - Automation Enthusiast

Brilliant!! It worked. Thank you so much!!