Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate the number of days for three months (current month and previous two months) when I select the current month.
Example: If I select Dec then I should get days from Dec, Nov, and Oct i.e. 92 days.
I am using the following code but it works only when I select Oct and Dec.
Floor(MonthEnd(Max([Posting Date])))- Floor(MonthStart(Min([Posting Date])))+ 1
Hi There,
I have a similar code running which is below, the trick is to do the calculation and bracket it then add the 1 day afterward.
(
Floor(MonthEnd(Max(if(CYTD_Ind = 1,[CalcDate]))))
-
AddMonths(monthstart(min(Floor(if(CYTD_Ind = 1,[CalcDate])))),1)
)+1
in your case:
(
Floor(MonthEnd(Max([Posting Date])))
-
AddMonths(monthstart(min(Floor([Posting Date]))),1)
)+1
Regards, Good Luck!
Perhaps this?
Count({<DateField = {">=$(=Date(MonthStart(AddMonths(Max(Month), -3)),'Your Date Format Here'))<=$(=Date(MonthEnd(Max(Month)),'Your Date Format Here'))"}>} DateField)