We can deal with the situation of sigiente ways.
At the end of our script, we can create a variable that always has the value of the previous month:
LET vPriorMonth = 'Month (AddMonths (Max (fulldate), -1))', / / Previous month in letters
LET vPriorMonthYear = 'Year (AddMonths (Max (fulldate), -1))', / / Year for the previous month
I am not sure, why you has used Max month & Max year in your above expression.
If I am understand you correct then, the below expressions can help you.
For Max date value from "rif" field =Date(max(rif))
For previous month of Max date =AddMonths( Date(max(rif)),-1)
Please explain bit more if this is not you are looking for?
thanks to all for your reply, but i didn’t explain exactly what i need.
In to the column “rif”, that contains date field, i want to extract by month-year, i don’t have all the months but only some months for exaple:
If i need to calc expressions only for the last period i don’t have any issue (=Text(Month(max(RIF)))& Text(Year(max(RIF)))=ott2013) buti f i need to calc only the previous time interval i need to help.
I suppose to use addmonth(-1) but the previous time interval isn’t always the previous month.
I dont’ have any result if i try to calculate a field like IR_TOTALE. I supposed to create another table (called ID) where i can record the inserts, in this case if want to consider only the previous month i can consider max(id-1) but i don’t know how to calculate the max(id-1) and the related RIF.
Finally i need also to calculate the previous period in a form like “feb2013” and not like a number.