Help

Re: Date filter - last month/last year

1201 0
cancel
Showing results for 
Search instead for 
Did you mean: 
nnnnneil
8 - Airtable Astronomer
8 - Airtable Astronomer

I’m using the following formula to flag records which were created “current month, last year”.

DATETIME_FORMAT({Order Received}, "YYYY-MM") = DATETIME_FORMAT(DATEADD(NOW(), "year", -1), "YYYY-MM")

Any suggestions on how to modify this to flag records created “last month, last year” ? E.g. If it is Nov 2019 now, it would flag records created in Oct 2018.

2 Replies 2
AndrewR
5 - Automation Enthusiast
5 - Automation Enthusiast

I don’t know how to get this into a single formula, but you could create another field that calculates Today -1 month and subtract 1 year from that date:

17%20AM

Then just hide the Today -1 month field.

This should be doable by nesting another DATEADD() function inside the existing one (and BTW, your DATEADD() format is incorrect; the modifier number comes before the type, not after it):

DATETIME_FORMAT({Order Received}, "YYYY-MM") = DATETIME_FORMAT(DATEADD(DATEADD(NOW(), -1, "year"), -1, "month"), "YYYY-MM")