Last Month

MONTH ([InvoicedDate]) = MONTH (TODAY ())

The above expression gives ma data for the current month based on [InvoicedDate].

What would be the expression to return data from Last month again based on [InvoicedDate] ?

Thanks

Solved Solved
0 8 385
1 ACCEPTED SOLUTION

Thank you Suvrutt
Works a treat and understoof over month-1 would revert to 0.

View solution in original post

8 REPLIES 8

MONTH ([InvoicedDate]) = MONTH (TODAY ())-1


So easy…
I had tried: MONTH ([InvoicedDate]) = MONTH (TODAY ()-1)

Thank You

I believe , if you wish the records to be returned for previous month of December ( Month number 12) in the month of January (Month number 1) next year, then the expression needs to be something like

IF(MONTH(TODAY())-1=0, AND(MONTH ([InvoiceDate])=12, YEAR([InvoiceDate])=YEAR(TODAY())-1) , MONTH ([InvoiceDate]) = MONTH (TODAY ())-1)

This is so because I believe in the month of January the expression MONTH (TODAY ()-1) will return 0 , instead of 12

Thank you Suvrutt
Works a treat and understoof over month-1 would revert to 0.

I believe @Suvrutt_Gurjar is correct in their assessment. You would want to be careful arbitrarily subtracting from just the month value as it could result in undesired results. Rather use the full date initially. I would suggest possibly exploring the EOMONTH([InvoiceDate], -1) function. I am not sure if the second parameter of the EOMONTH() function will take a negative value but it is worth a try.

Steve
Platinum 4
Platinum 4

Try:

(EOMONTH([InvoicedDate], 0) = EOMONTH(TODAY(), -1))

See also:

Nice. Very efficient @Steve. EOMONTH() is really powerful.

There is always great learning on writing compact expressions from you and @Aleksi

Thank you guys for the continued support. Appsheet is just the best…

Top Labels in this Space