<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pentalogic Technology &#187; Today</title>
	<atom:link href="http://blog.pentalogic.net/tag/today/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pentalogic.net</link>
	<description>Company blog and SharePoint Tricks and Tips</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:37:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>The &#8230; ehem&#8230; Truth about using [Today] in SharePoint Filters</title>
		<link>http://blog.pentalogic.net/2008/11/the-truth-about-using-today-in-filters/</link>
		<comments>http://blog.pentalogic.net/2008/11/the-truth-about-using-today-in-filters/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 15:54:08 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Calculated Columns]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[SharePoint Ideas]]></category>
		<category><![CDATA[Formula]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Today]]></category>

		<guid isPermaLink="false">http://blog.pentalogic.net/?p=94</guid>
		<description><![CDATA[This post looks at the different requirement for using [Today] in SharePoint Filters in SharePoint 2003 and 2007.


Related posts:<ol><li><a href='http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/' rel='bookmark' title='Permanent Link: The Truth about using [Today] in SharePoint Calculated Columns'>The Truth about using [Today] in SharePoint Calculated Columns</a> <small>This post offers workaround for using values like [Today] and...</small></li>
<li><a href='http://blog.pentalogic.net/2009/11/howto-filter-items-current-calendar-month-view-sharepoint/' rel='bookmark' title='Permanent Link: How To Use Filters in SharePoint to show items in the current Calendar Month'>How To Use Filters in SharePoint to show items in the current Calendar Month</a> <small> Its very easy using the Filter feature of SharePoint...</small></li>
<li><a href='http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/' rel='bookmark' title='Permanent Link: Advanced SharePoint View and Filter techniques'>Advanced SharePoint View and Filter techniques</a> <small>Advanced SharePoint view and filter techniques focusing on the task...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float:right; margin-top:-100px; clear:both;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.pentalogic.net%2F2008%2F11%2Fthe-truth-about-using-today-in-filters%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.pentalogic.net%2F2008%2F11%2Fthe-truth-about-using-today-in-filters%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Back in the day of Windows SharePoint Server 2 and SharePoint Server 2003 you couldn&#8217;t use <strong>[Today]</strong> in Filters.</p>
<p>For example if you tried to setup a filter like this to show items added in the last 7 days</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<div id="attachment_92" class="wp-caption aligncenter" style="width: 310px"> <em><strong><a href="http://blog.pentalogic.net/wp-content/uploads/2008/11/today-in-wss2-fitler.png"><img class="size-medium wp-image-92" title="today-in-wss2-fitler" src="http://blog.pentalogic.net/wp-content/uploads/2008/11/today-in-wss2-fitler-300x116.png" alt="Created is greater than [Today] - 7" width="300" height="116" /></a></strong></em></dt>
</dl>
</div>
<p style="text-align: center;"><em><strong>Created is greater than [Today] &#8211; 7</strong></em></p>
<p>You would receive an error <strong>&#8220;Filter Value is not a valid date&#8221;</strong> when clicking OK</p>
<p><span id="more-94"></span></p>
<p>This lead to all sorts of inventive work arounds including <a href="http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/">calculated columns to add 7 days onto the Created date</a> and the <a href="http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/">trick to use [Today] in calculated columns</a>.</p>
<p>After <a href="http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/">kicking up a bit of a storm with some ill considered remarks in a post explaining the limitations of the [Today] trick</a> I realised I had some of my own old posts that needed updating. Live by the sword&#8230;</p>
<h3>&lt;tongue-in-cheek&gt; The Truth about using [Today] in Filters &lt;/tongue-in-cheek&gt;</h3>
<p>In WSS 2 / SPS 2003 you could not use a filter containing a [Today] formula as shown above.</p>
<p>In WSS 3 / MOSS 2007 you can. If you try</p>
<p style="text-align: center;"><strong>Created is greater than [Today] &#8211; 7</strong></p>
<p>you see a similar error -</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_93" class="wp-caption aligncenter" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://blog.pentalogic.net/wp-content/uploads/2008/11/filter-value-is-not-in-a-supported-format.gif"><img class="size-medium wp-image-93" title="filter-value-is-not-in-a-supported-format" src="http://blog.pentalogic.net/wp-content/uploads/2008/11/filter-value-is-not-in-a-supported-format-300x142.gif" alt="&quot;Filter value is not in a supported date format&quot;" width="300" height="142" /></a><p class="wp-caption-text">&quot;Filter value is not in a supported date format&quot;</p></div>
<p><br class="spacer_" /></p>
<p><span style="color: #ff6600;"><strong>Try taking out the spaces&#8230;</strong></span></p>
<p><br class="spacer_" /></p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_97" class="wp-caption aligncenter" style="width: 310px;">
<dt class="wp-caption-dt"><em><strong><a href="http://blog.pentalogic.net/wp-content/uploads/2008/11/today-in-wss3-filter.gif"><img class="size-medium wp-image-97" title="today-in-wss3-filter" src="http://blog.pentalogic.net/wp-content/uploads/2008/11/today-in-wss3-filter-300x122.gif" alt="Created is greater than [Today]-7" width="300" height="122" /></a></strong></em></dt>
</dl>
</div>
<p style="text-align: center;"><em><strong>Created is greater than [Today]-7</strong></em></p>
<p>Yup, that easy.</p>
<p>Just to make clear &#8211; you can use other fields. For example to to show all the tasks due in the next 7 days or overdue.</p>
<p style="text-align: center;"><strong>Due Date is less than [Today]+7 AND Status is not equal to Completed</strong></p>
<p><a href="http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1782" target="_blank">If you are writing CAML queries then see this post about using the OffsetDays attribute.</a></p>


<p>Related posts:<ol><li><a href='http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/' rel='bookmark' title='Permanent Link: The Truth about using [Today] in SharePoint Calculated Columns'>The Truth about using [Today] in SharePoint Calculated Columns</a> <small>This post offers workaround for using values like [Today] and...</small></li>
<li><a href='http://blog.pentalogic.net/2009/11/howto-filter-items-current-calendar-month-view-sharepoint/' rel='bookmark' title='Permanent Link: How To Use Filters in SharePoint to show items in the current Calendar Month'>How To Use Filters in SharePoint to show items in the current Calendar Month</a> <small> Its very easy using the Filter feature of SharePoint...</small></li>
<li><a href='http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/' rel='bookmark' title='Permanent Link: Advanced SharePoint View and Filter techniques'>Advanced SharePoint View and Filter techniques</a> <small>Advanced SharePoint view and filter techniques focusing on the task...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.pentalogic.net/2008/11/the-truth-about-using-today-in-filters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Truth about using [Today] in SharePoint Calculated Columns</title>
		<link>http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/</link>
		<comments>http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 13:36:34 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Calculated Columns]]></category>
		<category><![CDATA[SharePoint Ideas]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Today]]></category>

		<guid isPermaLink="false">http://blog.pentalogic.net/?p=76</guid>
		<description><![CDATA[This post offers workaround for using values like [Today] and [Me] in SharePoint Calculated Columns


Related posts:<ol><li><a href='http://blog.pentalogic.net/2008/11/working-days-weekdays-holidays-sharepoint-calculated-columns/' rel='bookmark' title='Permanent Link: Working Days, Weekdays and Holidays in SharePoint Calculated Columns'>Working Days, Weekdays and Holidays in SharePoint Calculated Columns</a> <small>This post shows you how to work with weekdays and...</small></li>
<li><a href='http://blog.pentalogic.net/2010/05/calculated-columns-adding-hours-onto-a-date-field/' rel='bookmark' title='Permanent Link: SharePoint Calculated columns &#8211; Adding hours onto a date field'>SharePoint Calculated columns &#8211; Adding hours onto a date field</a> <small> A customer recently contacted me with an interesting question....</small></li>
<li><a href='http://blog.pentalogic.net/2008/11/the-truth-about-using-today-in-filters/' rel='bookmark' title='Permanent Link: The &#8230; ehem&#8230; Truth about using [Today] in SharePoint Filters'>The &#8230; ehem&#8230; Truth about using [Today] in SharePoint Filters</a> <small>This post looks at the different requirement for using [Today]...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float:right; margin-top:-100px; clear:both;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.pentalogic.net%2F2008%2F11%2Ftruth-about-using-today-in-calculated-columns%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.pentalogic.net%2F2008%2F11%2Ftruth-about-using-today-in-calculated-columns%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you try to create a calculated column with a formula containing [Today] or [Me] SharePoint gives the error :</p>
<pre><span style="color: #ff0000;">“Calculated columns cannot contain volatile functions like Today and Me”</span></pre>
<p>There are a few reasons you might want to do this. One would be to display how many days left you have to complete something, the other is to only show things added in the last X days or due in the next X days.</p>
<p>There are many pages mentioning this workaround :-</p>
<p>1) Create a dummy column called &#8220;Today&#8221;, then add your calculated column using [Today] in the formula, finally delete the dummy column. If you need to edit the formula then you have to go back to the start and add the dummy column again.</p>
<p>2) Optionally you can create a calculated column called &#8220;My Today&#8221; and set its formula to =[Today] using the trick above. Reference [My Today] in your other calculated columns. Thus you reference [My Today] which in turn references [Today]. Then you will not have to add the dummy column back in every time you want to edit formulae.</p>
<p>You then pat your self on the back and head home after another successful day of harassing SharePoint to do what you want, Hurrah!</p>
<p>But the next day you take a look at your list and its wrong. The formula has not updated and its still showing yesterdays value. DOH! SharePoint has made a fool of you after all.</p>
<p>Turns around there is actually a good reason for SharePoint not allowing volatile functions like [Today] or [Me] in calculated columns.</p>
<p><strong>&#8220;Calculated fields don&#8217;t update themselves until item itself is updated.&#8221;</strong></p>
<p>Read that again.</p>
<p>The value of a calculated column is only updated when item is edited and in the mean time you will see incorrect calculations every time you look. In fact, for most uses, this trick don&#8217;t give you anything more than just <a href="http://pathtosharepoint.wordpress.com/2008/08/14/calculated-columns-the-useless-today-trick/" target="_blank">referencing the [Modifed] column.</a></p>
<p>One workaround to the workaround problem is to <a href="http://www.sharepointblogs.com/dez/archive/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference.aspx" target="_blank">write a console app to find all these lists that use the [Today] trick and update them automatically once per day.</a> <em>But this workaround to the workaround problem may not be without its own problems that need to be worked around&#8230;.</em></p>
<p>Depending on your need there may be a simpler way &#8211; turn the problem on its head!</p>
<p><a href="http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/" target="_blank">In the example of using a calculated column to filter out items due in x days or overdue</a> SharePoint will accept [Today] as part of the <strong>Filter </strong>but will not as part of a calculated column &#8211; so give it what it wants</p>
<p><a href="http://blog.pentalogic.net/2008/11/the-ehem-truth-about-using-today-in-filters/">[EDIT- WSS 3 / MOSS 2007 now accepts this]</a></p>
<ul>
<li>Use a filter of [Created] is greater than [Today]-7</li>
</ul>
<p><em>(Note &#8211; its essential to have no spaces; [Today] &#8211; 7 will not work but [Today]-7 does.</em></p>
<p><strong>WSS 2 / SPS 2003</strong></p>
<ul>
<li>Create a column called <strong>&#8220;Filter 7 Days&#8221; and formula as =Created+7</strong></li>
<li>Then use a filter of <strong>&#8220;Filter 7 Days&#8221; is less than </strong><strong>[Today]</strong></li>
</ul>
<p>See this page for more details &#8211; <a href="http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/">http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/</a></p>
<ul>
<strong></strong>
</ul>
<p>So the calculated column is not dynamic (it will never need updating unless the record itself changes) and SharePoint is happy &#8211; but the filter <em>is dynamic</em> and you are happy!</p>
<p>If you want a countdown in your view (i.e. <a href="http://pathtosharepoint.wordpress.com/2008/08/25/a-countdown-for-tasks-lists/" target="_blank">Days left to complete a task</a>) then take a look at this post &#8211; <a href="http://pathtosharepoint.wordpress.com/2008/08/25/a-countdown-for-tasks-lists/" target="_blank">http://pathtosharepoint.wordpress.com/2008/08/25/a-countdown-for-tasks-lists/</a></p>
<p>Shameless plug &#8211; check this product out if you want <a href="http://www.pentalogic.net/sharepoint-reminder.aspx">&#8220;Alert Me&#8221; type emails when a task is due soon or overdue.</a></p>
<p><em>[EDIT] As it&#8217;s been pointed out to me the tone of this article was off from what I intended &#8211; the intention is to make clear that this well known and oft mentioned trick does not work as you might expect and to offer alternatives.</em></p>


<p>Related posts:<ol><li><a href='http://blog.pentalogic.net/2008/11/working-days-weekdays-holidays-sharepoint-calculated-columns/' rel='bookmark' title='Permanent Link: Working Days, Weekdays and Holidays in SharePoint Calculated Columns'>Working Days, Weekdays and Holidays in SharePoint Calculated Columns</a> <small>This post shows you how to work with weekdays and...</small></li>
<li><a href='http://blog.pentalogic.net/2010/05/calculated-columns-adding-hours-onto-a-date-field/' rel='bookmark' title='Permanent Link: SharePoint Calculated columns &#8211; Adding hours onto a date field'>SharePoint Calculated columns &#8211; Adding hours onto a date field</a> <small> A customer recently contacted me with an interesting question....</small></li>
<li><a href='http://blog.pentalogic.net/2008/11/the-truth-about-using-today-in-filters/' rel='bookmark' title='Permanent Link: The &#8230; ehem&#8230; Truth about using [Today] in SharePoint Filters'>The &#8230; ehem&#8230; Truth about using [Today] in SharePoint Filters</a> <small>This post looks at the different requirement for using [Today]...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
