Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hammermill21
Creator III
Creator III

Getting Current Month and Year & Previous Month and Year

Hello!

I have been calculating the current month with the expression:

=Date(Max(MakeDate(2018,MonthNum,1)),'MMM') & ' ' & Max(Year)

And the previous month with:

=Date(MonthStart(Max(MakeDate(2018, MonthNum, 1)), -1), 'MMM YYYY')

How would I go about updating it so it picks up 2019? I tried changing 2018 to 2019 but that is not working, any ideas?

Thanks!

 

 

1 Solution

Accepted Solutions
sunny_talwar

So, you are showing this in a text box object? Is this completely based on today's date? Why don't you just use
For current Month

=Date(MonthStart(Today()), 'MMM YYYY')

For Previous Month

=Date(MonthStart(Today(), -1), 'MMM YYYY')

View solution in original post

4 Replies
sunny_talwar

Where are you trying to do this? What exactly is MonthNum and Year in your expressions?
hammermill21
Creator III
Creator III
Author

Hi Sunny,

I have this in my master calendar:

Mastercalendar:
Load
TempDate as ActualDate,
monthname(TempDate) as YearMonth,
monthname(TempDate) as MonthYear,
num(month(TempDate)) as MonthNum,
day(TempDate) as Day,
weekday (TempDate) as WeekDay,
week(TempDate) as Week,
year(yearstart(TempDate,0,4)) as FiscalYear, 
InYearToDate(TempDate,$(vToday),0) * -1 as CurYTDFlag,
InYearToDate(TempDate,$(vToday),-1) * -1 as LastYTDFlag

So I'm trying to show the max Month and max year in a text box. I'm doing this so I can update my reports in NPrinitng.

 

 

 

 

sunny_talwar

So, you are showing this in a text box object? Is this completely based on today's date? Why don't you just use
For current Month

=Date(MonthStart(Today()), 'MMM YYYY')

For Previous Month

=Date(MonthStart(Today(), -1), 'MMM YYYY')
hammermill21
Creator III
Creator III
Author

Hey Sunny,

 

Thank you that is working. I think my issue was with the filter I had in NPrinting but I was able to update that also.

Thank you for your help!!!