Calculated Column Dynamically Updated (When using [Today])


Today I was asked a fairly common question that everyone who uses calculated columns eventually runs into. “How do you get a column to calculate automatically when using a reference for a date, or something that dynamically changes like [Today]?” Out of the box this isn’t available because the calculated columns ONLY calculate when an item is updated.

The solution is simple, you write a custom solution that updates all items as desired. So this could be something that runs daily or every time you view the data (using a dashboard). You could even write the code so it adds and removes the column instead of iterating through the items. Do some performance testing to see which is faster in your case.

A terrific Article was posted by Dink that answers exactly how to do it too with free samples: http://www.sharepointblogs.com/dez/archive/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference.aspx

There is also a post here by Chris where he uses the DataView and JavaScript: http://pathtosharepoint.wordpress.com/2008/08/25/a-countdown-for-tasks-lists/

Hopefully this helps someone out,
Richard Harbridge

About these ads
Explore posts in the same categories: Fix, Issue Resolution, SharePoint 2007, Tips and Tricks, Workaround

Tags: , , ,

You can comment below, or link to this permanent URL from your own site.

One Comment on “Calculated Column Dynamically Updated (When using [Today])”

  1. Ryan Says:

    This page goes into more details about this and why the well known dummy Today column no longer works in SharePoint 2007.

    http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/

    There are also two workarounds that do work for filtering items due in X days or added in last X days and also how to implement a ‘countdown’ in a data view that shows difference between a date and todays date


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: