06 March 2012

A sharepoint list view of the current month

Who has not asked to make view of the current month?
And every time we need to reinvent the wheel.

This time I'll show how to do this:

Need to create two columns
1. Start of the Month
2. End of the Month
Two columns need type -"calculated"

The formula of "Start of the Month"

=DATE(YEAR(Created),MONTH(Created),1)



The formula of "End of the Month"

=DATE(YEAR(Created),MONTH(Created)+1,1)-1

The view definition in the "Filter":

"Start of the Month" is Less than or Equle to [Today]
Or
"End of the Month" is Greater than or Equal to [Today]

Here is the result:
Hope i helped,
Roi

17 comments:

Anonymous said...

Thanks so much for taking the time to share this!!!!

Steve Warner said...

thank you as well

Anonymous said...

Thanks a bunch! Saved the day for handling a process for delivering awards!

Cheers!

Anonymous said...

My calculated fields are working fine, however, my display is not the current month. I am looking to display only those items received in the current month. The filters don't appear to work and I'm not sure how you go about creating the correct filter. Thoughts anyone?

Anonymous said...

Minor mistake in your instructions. The filter should be 'AND' not 'OR.'

Got it to work!

Roi kolbinger said...

Thank you - you are absolutely right
Should be AND
I'll fix the post

Anonymous said...

This is great. Thank you very much

RafaMasterSP said...

Simple and smart. Thanks for the solution. It worked perfectly.

Unknown said...

Love the =DATE(YEAR(Created),MONTH(Created)+1,1)-1!

Unknown said...

How to find the Due During the current month based on two columns like
Frequency(Annual,Monthly,Quarterly and Weekly) and Start Date(6/1/2016)? Help on this

Roi kolbinger said...

hi Krishna Reddy,
I don't understand what you mean ? You have two fields which should be available in the beginning of the month ? It is not clear...

Anonymous said...

Hello, thanks a lot for your blog. It helped me much. Could you pls also provide how to set a filter on data from last and penultimate month?
Many thx in advance and greetings from germany.

Roi kolbinger said...

hi
try this formula at "End of the Month"
IF(MONTH(Created)=12,DATE(YEAR(Created)+1,MONTH(Created)+1,1)-1,DATE(YEAR(Created),MONTH(Created)+1,1)-1)

Anonymous said...

Hi Roi,
thx for yor effort but it's not exactly what i wanted.
I should be able to display data created last month, in the current month and in the next month. In the middle of each month, we create per PS-Script new 60 Data sets for the next month. These are our Service-Center. Probably i must have a 'hidden column' with value of the month the data was created for, with data type number or date. We could name it 'CreatedForMonth' and it should contain the value of the next month either as number or date value, considering the handling of value of december (because 12+1=13).
Then it must be possible to create different views with help of a calculating column that contains the value like: date(month(Created)-month(CreatedForMonth). As result this could be the values: -1 for next month, 0 for current month and 1 for previous month.
Do you know if this is possible in sharepoint 2013 foundation?

Many thanks for your reply

Roi kolbinger said...

hi...
I believe you should develop a field (by code) :(

Unknown said...

Please not the filter is an AND not OR

Nanoryt said...

This works great for the current year. If I want to filter an employee birthdays list by month, due to the birth year being in the 19's the filter doesn't filter by month. If I change the users birthday year to the current year, then the filter works and filters by current month.

Post a Comment