Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I m trying to find the current month and the prcedent one
So for current month I worked with this expression and it done well : MonthName(Max(Month))
But for the Precedent Month this expression return a number : (Max(Month)-1) =42095
and this one (= MonthName((Max(Month))-1)) return the same result as (MonthName(Max(Month))).
Help
Try this:
MonthName(AddMonths(Max(Month), -1))
Try MonthName(Max(Month,2))
Hi,
that "MonthName(Max(Month))" is working for you means that "Month" holds date values.
Subtracting 1 from a date value again means subtracting one day, even if this field is called Month.
One solution might be to use the "shift" parameter of the MonthName() function to return the previous month:
MonthName(Max(Month),-1)
hope this helps
regards
Marco
Thank you .
It work but return "Nov.2015"
Thank you but it didn't return any result '-'
Thank you
This solution work too but with the same problem as SunnyT's proposition it return the date like this 'Nov.2015' and I need only the month.
I findet
I should like this write my expression : date((MonthName(Max(Month),-1)),'MM')
but why this MonthName(AddMonths(Max(Month), -1)) return the years too !
Perhaps the expressions you need are
MonthName(Max(Month)) and MonthName(Max(Month), -1) to return year/month values, or
Month(Max(Month)) and Month(AddMonths(Max(Month), -1)) to return month only values