Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get the Current month and year

Hello Friends

As I need to store the current month and Year in a variable, what is the function available to get it.

Regards

Chriss.....

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

use this

=MonthName(addmonths(today(),-1))

Regrds

Apurva

View solution in original post

11 Replies
Not applicable
Author

Hi,

vCurrentYear= year(today())

vCurrentMonth= month(today())

Regards

Apurva

Not applicable
Author

Hello Apurva,

Thanks for your reply, my requirement is I need to store the Month and Year in a single variable

like vCurrentMonYear = June 2012. is it possible ....

Regards

Chriss

Not applicable
Author

Hi,

use this->  vCurrentYM= monthname(today())

regards

Apurva

Not applicable
Author

Thanks Apurva............

Not applicable
Author

Hello Apurva,

I need one more favour Using Monthname(today()) I can get the Current Month and Year but when i try Monthname(today()-1) to get the previous month its not working..

Please help me...

Regards

Chriss

jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

Try this =Date(MonthName(Today())-1,'MMM YYYY')

jonathandienst
Partner - Champion III
Partner - Champion III

Chris

No that will get the month name for yesterday. For the previous month use

MonthName(AddMonths(Today(), -1))

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

use this

=MonthName(addmonths(today(),-1))

Regrds

Apurva

Not applicable
Author

Yes, its works.... thanks a lot Apurva...