Date filter - last month/last year

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.

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:

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")

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.