RSS Feed Is this your first time here? Get regular updates

The … ehem… Truth about using [Today] in SharePoint Filters

Date:November 25th, 2008 Author:Ryan Tags: , ,
Category: Calculated Columns, Filter, SharePoint Ideas Comments:1 ;

Back in the day of Windows SharePoint Server 2 and SharePoint Server 2003 you couldn’t use [Today] in Filters.

For example if you tried to setup a filter like this to show items added in the last 7 days



Created is greater than [Today] - 7

Created is greater than [Today] – 7

You would receive an error “Filter Value is not a valid date” when clicking OK

This lead to all sorts of inventive work arounds including calculated columns to add 7 days onto the Created date and the trick to use [Today] in calculated columns.

After kicking up a bit of a storm with some ill considered remarks in a post explaining the limitations of the [Today] trick I realised I had some of my own old posts that needed updating. Live by the sword…

<tongue-in-cheek> The Truth about using [Today] in Filters </tongue-in-cheek>

In WSS 2 / SPS 2003 you could not use a filter containing a [Today] formula as shown above.

In WSS 3 / MOSS 2007 you can. If you try

Created is greater than [Today] – 7

you see a similar error -

"Filter value is not in a supported date format"

"Filter value is not in a supported date format"


Try taking out the spaces…


Created is greater than [Today]-7

Created is greater than [Today]-7

Yup, that easy.

Just to make clear – you can use other fields. For example to to show all the tasks due in the next 7 days or overdue.

Due Date is less than [Today]+7 AND Status is not equal to Completed

If you are writing CAML queries then see this post about using the OffsetDays attribute.

Related posts:

  1. The Truth about using [Today] in SharePoint Calculated Columns This post offers workaround for using values like [Today] and...
  2. How To Use Filters in SharePoint to show items in the current Calendar Month Its very easy using the Filter feature of SharePoint...
  3. Advanced SharePoint View and Filter techniques Advanced SharePoint view and filter techniques focusing on the task...
  4. How To setup a SharePoint view filter to compare 2 list fields SharePoint workaround to create a list view based on a...
  5. Using [Today] in SharePoint calculated default values You can't use Today in SharePoint calculated columns but you...

Tags: , ,

Did you enjoy this post? Get the next one by RSS or by email

Share:

One Response to “The … ehem… Truth about using [Today] in SharePoint Filters”

  1. Chris Shepherd says:

    Thanks for that – a space was riving me mad!

Leave a Reply