Tuesday, 19 December 2006

CM will return the last day of a month.

CALCDATE ('CM', date) will return the last day of the month.

To get the first day of the month,
use CALCDATE ('CM-1M+1D', date);

5 comments:

rakesh said...

CALCDATE('-CM',Today) will give correct result of First day of month

Martin said...

Thank you!

Akhilesh said...

thanks

Anonymous said...

Thank you for this!

Tio D said...

I actually received the wrong date with the original calculation. When trying to calculate the first day of November (the current month) I used the formula from the OP and got 10/31/2015. As best I can tell the "-1M" only does 30-day increments, so I ended up with the calculation:

11/30/2015 - 30D + 1D = 10/31/2015.

The follow up post that recommended using -CM worked perfectly.