<?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; Formula</title>
	<atom:link href="http://blog.pentalogic.net/tag/formula/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>SharePoint Calculated columns &#8211; Adding hours onto a date field</title>
		<link>http://blog.pentalogic.net/2010/05/calculated-columns-adding-hours-onto-a-date-field/</link>
		<comments>http://blog.pentalogic.net/2010/05/calculated-columns-adding-hours-onto-a-date-field/#comments</comments>
		<pubDate>Tue, 18 May 2010 09:53:35 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SharePoint Ideas]]></category>
		<category><![CDATA[Calculated Columns]]></category>
		<category><![CDATA[Formula]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://blog.pentalogic.net/?p=825</guid>
		<description><![CDATA[
			
				
			
		
A customer recently contacted me with an interesting question.
They were using a SharePoint task list to help schedule jobs for field engineers but rather than have a Start Date and End Date field they wanted to have a Start Date and Duration field and automatically work out the End Date.
So End Date = Start Date [...]


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/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/10/tip-multiple-columns-planner-gantt-chart/' rel='bookmark' title='Permanent Link: Tip &#8211; Showing multiple columns in SharePoint Planner Webpart'>Tip &#8211; Showing multiple columns in SharePoint Planner Webpart</a> <small>This post shows how to show data from more than...</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%2F2010%2F05%2Fcalculated-columns-adding-hours-onto-a-date-field%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.pentalogic.net%2F2010%2F05%2Fcalculated-columns-adding-hours-onto-a-date-field%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A customer recently contacted me with an interesting question.</p>
<p>They were using a SharePoint task list to help schedule jobs for field engineers but rather than have a Start Date and End Date field they wanted to have a Start Date and Duration field and automatically work out the End Date.</p>
<p>So <strong>End Date = Start Date + Duration</strong></p>
<p>They were then planning to display this using Planner in the <a href="http://www.pentalogic.net/sharepoint-products/planner/planner-manual?p=configuration/config_plannerstyle.htm">By Category</a> view which is <a href="http://www.pentalogic.net/sharepoint-products/planner">idea for resource booking as it makes it easy to see when a resource is booked or free</a> (SharePoints built in gantt chart can&#8217;t do this swimlane style of view and doesn&#8217;t support using calculated columns).</p>
<p>Now this is easy to do if the Duration is specified in days &#8211; in fact you just use the equation above &#8211; <strong>but what if Duration is in hours or minutes?</strong></p>
<p>First port of call is this page from Microsoft showing <a rel="nofollow" href="http://office.microsoft.com/en-us/sharepointtechnology/HA011609471033.aspx" target="_blank">examples of common date time formula you can use in SharePoint calculated columns</a> hmmm, adding days OK&#8230; adding months Check&#8230; adding years OK too&#8230;.but nothing about hours. Back to the drawing board.</p>
<p><span id="more-825"></span></p>
<p>The key bit of knowledge is that <strong>SharePoint stores all date/time values internally as the number of days since Jan 1st, 1900. </strong>So the number 100.5 in a date/time field is 100 days and 12 hours from 1st Jan 1900 at 00:00</p>
<table border="0">
<tbody>
<tr>
<td>
<p>Armed with this we get the following formula (where Duration is in hours)</p>
<p><strong>=[Start Date]+([Duration]/24)</strong></p>
<p>So what&#8217;s happening here?</p>
<p><strong>([Duration]/24) </strong>turns the number of hours in Duration to fractions of a day (e.g. 1 hr is 0.0416 of a day)</p>
<p>Then we add that number to the Start Date and finally as our calculated column is defined as a date/time field SharePoint is turning the number (e.g. 40,296.50) back into a readable date/time value.</p>
<p>Job done!</p>
<p><strong>Tips</strong></p>
<ul>
<li>This will work with Durations greater than 24 or even 1/2 hours etc.</li>
<li>If you want to specify Duration in minutes then instead of /24 above you would use /1440 (the number of minutes in a day).</li>
<li>You can use this for anything that has a duration &#8211; tasks, service jobs, meetings, flights, equipment booking etc.</li>
</ul>
<p><strong>Further reading</strong></p>
<ul>
<li><a href="http://abstractspaces.wordpress.com/2009/05/02/common-date- time-formulas-for-sharepoint-calculated-fields/" target="_blank">Common Date Time formulas for SharePoint</a></li>
</ul>
</td>
<td><a href="http://blog.pentalogic.net/wp-content/uploads/2010/05/sharepoint-calculated-column-add-hours-date.png"><img class="alignright size-full wp-image-833" title="SharePoint calculated column - adding hours to a date" src="http://blog.pentalogic.net/wp-content/uploads/2010/05/sharepoint-calculated-column-add-hours-date.png" alt="" width="271" height="442" /></a></td>
</tr>
</tbody>
</table>


<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/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/10/tip-multiple-columns-planner-gantt-chart/' rel='bookmark' title='Permanent Link: Tip &#8211; Showing multiple columns in SharePoint Planner Webpart'>Tip &#8211; Showing multiple columns in SharePoint Planner Webpart</a> <small>This post shows how to show data from more than...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.pentalogic.net/2010/05/calculated-columns-adding-hours-onto-a-date-field/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tip &#8211; Showing multiple columns in SharePoint Planner Webpart</title>
		<link>http://blog.pentalogic.net/2009/10/tip-multiple-columns-planner-gantt-chart/</link>
		<comments>http://blog.pentalogic.net/2009/10/tip-multiple-columns-planner-gantt-chart/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 13:05:20 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Calculated Columns]]></category>
		<category><![CDATA[SharePoint Planner]]></category>
		<category><![CDATA[SharePoint webparts]]></category>
		<category><![CDATA[Formula]]></category>
		<category><![CDATA[gantt]]></category>
		<category><![CDATA[Planner]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[WebPart]]></category>

		<guid isPermaLink="false">http://blog.pentalogic.net/?p=304</guid>
		<description><![CDATA[This post shows how to show data from more than one list column in one category or timeline in a SharePoint Planner webpart gantt view


Related posts:<ol><li><a href='http://blog.pentalogic.net/2008/10/adding-gridlines-to-the-planner-gantt-chart/' rel='bookmark' title='Permanent Link: Adding gridlines to the SharePoint Planner webpart Gantt chart'>Adding gridlines to the SharePoint Planner webpart Gantt chart</a> <small>This post shows how to use CSS to add gridlines...</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/2009/06/sharepoint-planner-new-version2-5-3/' rel='bookmark' title='Permanent Link: New version of SharePoint Planner Webpart (2.5.3)'>New version of SharePoint Planner Webpart (2.5.3)</a> <small>Version 2.5.3 of SharePoint Planner webpart is now available with...</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%2F2009%2F10%2Ftip-multiple-columns-planner-gantt-chart%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.pentalogic.net%2F2009%2F10%2Ftip-multiple-columns-planner-gantt-chart%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>There may be times when you want to display timeline or category information from more than one list column in a gantt chart. For example in the chart below we have taken information from the &#8220;priority&#8221; and &#8220;title&#8221; columns of a list to populate the category labels.</p>
<p>With Planner you can show multiple columns in the <a href="http://www.pentalogic.net/sharepoint-planner-v2/manual.aspx?Page=configuration%2fconfig_plannersource.htm">Category or on the Timeline of a Gantt chart</a> by using a calculated column to merge fields together.</p>
<p><img class="aligncenter size-full wp-image-305" title="concat-columns" src="http://blog.pentalogic.net/wp-content/uploads/2009/10/concat-columns.png" alt="concat-columns" width="600" height="87" /><br />
 For example to merge Priority and Title columns together you would :-</p>
<p><br class="spacer_" /></p>
<ul>
<li>From your list click Settings &gt; Create Column</li>
<li>Set a name such as &#8220;Category&#8221;</li>
<li>Choose Calculated for the type</li>
<li>In formula enter <em>(where [Title] etc is the name of the columns you want to merge)</em></li>
</ul>
<pre>      =[Priority] &amp; " : " &amp; [Title]</pre>
<ul>
<li>Uncheck &#8216;Add to default view&#8217; checkbox if you don&#8217;t want this appearing for the normal list view.</li>
<li>In Planner you can now select this column.</li>
</ul>
<p>You can merge multiple columns together, for example :-</p>
<pre>   =[Priority] &amp; " : " &amp; [Title] &amp; " - " &amp; [Assigned To]</pre>
<p>You can also use <a href="http://office.microsoft.com/en-us/sharepointtechnology/CH100650061033.aspx" target="_blank">SharePoint standard functions and formula</a> (many similar to excel) such as :-</p>
<pre>   =Text([Start Time],"mmm-yyyy") " : " &amp; [Title]</pre>
<p>Which would prefix the Title with Month and year, like so  <em>October-2009 : Your title here</em></p>
<p>To display the the duration in days you could use</p>
<pre>   =DATEDIF([Start Time],[End Time],"d") &amp; " Days"</pre>
<p><a href="http://office.microsoft.com/en-us/sharepointtechnology/HA101054791033.aspx?pid=CH100650061033#2" target="_blank">See some more examples of common functions</a></p>


<p>Related posts:<ol><li><a href='http://blog.pentalogic.net/2008/10/adding-gridlines-to-the-planner-gantt-chart/' rel='bookmark' title='Permanent Link: Adding gridlines to the SharePoint Planner webpart Gantt chart'>Adding gridlines to the SharePoint Planner webpart Gantt chart</a> <small>This post shows how to use CSS to add gridlines...</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/2009/06/sharepoint-planner-new-version2-5-3/' rel='bookmark' title='Permanent Link: New version of SharePoint Planner Webpart (2.5.3)'>New version of SharePoint Planner Webpart (2.5.3)</a> <small>Version 2.5.3 of SharePoint Planner webpart is now available with...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.pentalogic.net/2009/10/tip-multiple-columns-planner-gantt-chart/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>Advanced SharePoint View and Filter techniques</title>
		<link>http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/</link>
		<comments>http://blog.pentalogic.net/2008/10/advanced-sharepoint-view-and-filters/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 17:26:41 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Filter]]></category>
		<category><![CDATA[SharePoint Ideas]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[Formula]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[View]]></category>

		<guid isPermaLink="false">http://blog.pentalogic.net/?p=49</guid>
		<description><![CDATA[Advanced SharePoint view and filter techniques focusing on the task list.  includes filters for My Overdue Tasks and Tasks Due in the next 7 Days. 


Related posts:<ol><li><a href='http://blog.pentalogic.net/2010/06/how-to-setup-sharepoint-view-filter-to-compare-2-list-fields/' rel='bookmark' title='Permanent Link: How To setup a SharePoint view filter to compare 2 list fields'>How To setup a SharePoint view filter to compare 2 list fields</a> <small>SharePoint workaround to create a list view based on a...</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/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%2F10%2Fadvanced-sharepoint-view-and-filters%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.pentalogic.net%2F2008%2F10%2Fadvanced-sharepoint-view-and-filters%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Introduction</h3>
<p>We discussed in a  previous article how to customise <a title="Customise Task List" href="http://blog.pentalogic.net/2008/10/extend-and-customise-sharepoint-task-lists/">SharePoint&#8217;s built in Task List</a> and briefly looked at the power of Views with Filters. In this article we will build upon that by demonstrating some advanced use of Filters.</p>
<p>This article assumes that you are already familiar with Views and Filters &#8211;  if not please review the  <a title="Customise SharePoint Task List" href="http://blog.pentalogic.net/2008/10/extend-and-customise-sharepoint-task-lists/">previous article</a>.</p>
<p><span id="more-49"></span></p>
<h3>Overdue Tasks</h3>
<table id="table2" style="width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td>To show a task lists Overdue tasks use the following Filter :-</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<ul>
<li>Status &#8211; is not equal to &#8211; Completed</li>
</ul>
<p>And</p>
<ul>
<li>Due Date &#8211; is less than &#8211; [Today]</li>
</ul>
<p><em>Note &#8211; [Today] is a special marker that SharePoint understands as  		the current date.</em></p>
</td>
<td><img class="aligncenter size-full wp-image-50" title="adv-filter-overdue-tasks" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-overdue-tasks.gif" alt="Overdue Tasks" width="408" height="236" /></td>
</tr>
</tbody>
</table>
<h3>My Overdue Tasks</h3>
<table id="table1" style="width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td>Add the following to the Overdue Tasks filter</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<ul>
<li>Assigned To &#8211; is equal to &#8211; [Me]</li>
</ul>
<p><em>Note &#8211; [Me] is a special marker that SharePoint understands as the  		current user.</em></p>
</td>
<td><img class="aligncenter size-full wp-image-51" title="adv-filter-my-overdue-tasks" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-my-overdue-tasks.gif" alt="" width="408" height="91" /></td>
</tr>
</tbody>
</table>
<h3><strong>Items added in Last 7 Days</strong></h3>
<p>It would be nice to be able to enter something like</p>
<ul>
<li>Created &#8211; is less than &#8211; [Today] &#8211; 7</li>
</ul>
<p>in the filter, but alas its not quite that simple!</p>
<p><em><a href="http://blog.pentalogic.net/2008/11/the-ehem-truth-about-using-today-in-filters/">[EDIT - This work around was written in early 2006 and WSS 2 / SPS 2003 wouldn't accept this - in WSS 3 / MOSS 2007 you can now use a FILTER formula like [Today]-7 as long as you keep the spaces out!]</a></em></p>
<p>The workaround is to create a Calculated column and then filter on that  column.</p>
<table id="table3" class="layoutTableSeperated" style="width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td>Select <strong>Modify Settings and Columns</strong>, then <strong>Add a new column</strong>Give the column name something like &#8220;Filter 7 Days&#8221; and select a <strong> Calculated</strong> column</td>
<td>
<p style="text-align: center;"><img class="size-full wp-image-52 aligncenter" title="adv-filter-7-days" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-7-days.gif" alt="Name the view &quot;Filter 7 Days&quot;" width="322" height="188" /></p>
</td>
</tr>
<tr>
<td>Enter a suitable <strong>Description</strong>In the <strong>Formula</strong> box  		enter &#8220;=Created+7&#8243;Choose <strong>Date and Time</strong> format and <strong>Date Only</strong></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Clear <strong>Add to default view</strong> as we don&#8217;t want this field to  		appear on any of the views</p>
</td>
<td><img class="aligncenter size-full wp-image-53" title="adv-filter-7-days-formula" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-7-days-formula.gif" alt="Set the calculated columns formula" width="322" height="288" /></td>
</tr>
<tr>
<td>Create a new viewSetup a filter to show only :-</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<ul>
<li>Filter 7 Days &#8211; is greater than or equal to &#8211; [Today]</li>
</ul>
</td>
<td><img class="aligncenter size-full wp-image-54" title="adv-filter-7-days-filter" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-7-days-filter.gif" alt="Set the views filter" width="340" height="130" /></td>
</tr>
</tbody>
</table>
<h3>Items Due in the next 7 Days</h3>
<p><em><a href="http://blog.pentalogic.net/2008/11/the-ehem-truth-about-using-today-in-filters/">[EDIT - This work around was written in early 2006 and WSS 2 / SPS 2003 wouldn't accept this - in WSS 3 / MOSS 2007 you can now use a FILTER formula like [Due Date]-7 as long as you keep the spaces out!]</a></em></p>
<table id="table4" class="layoutTableSeperated" style="width: 100%;" border="0" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<td>Select <strong>Modify Settings and Columns</strong>, then <strong>Add a new column</strong>Give the column name something like &#8220;Filter Coming Due&#8221; and select a <strong> Calculated</strong> column</td>
<td><a href="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-coming-due-name.gif"><img class="aligncenter size-full wp-image-56" title="adv-filter-coming-due-name" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-coming-due-name.gif" alt="Set the new columns name and choose &quot;calculated column&quot;" width="323" height="173" /></a></td>
</tr>
<tr>
<td>Enter a suitable <strong>Description</strong>In the <strong>Formula</strong> box  		enter &#8220;=Due Date-7&#8243;Choose <strong>Date and Time</strong> format and <strong>Date Only</strong></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Clear <strong>Add to default view</strong> as we don&#8217;t want this field to  		appear on any of the views</p>
</td>
<td><a href="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-coming-due-formula.gif"><img class="aligncenter size-full wp-image-57" title="adv-filter-coming-due-formula" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-coming-due-formula.gif" alt="Set the calculated columns formula" width="320" height="286" /></a></td>
</tr>
<tr>
<td>Create a new viewSetup a filter to show only :-</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<ul>
<li>Status &#8211; is not equal to &#8211; Completed</li>
</ul>
<p>And</p>
<ul>
<li>Filter Coming Due &#8211; is less than or equal to &#8211; [Today]</li>
</ul>
<p>And</p>
<ul>
<li>Due Date &#8211; is greater than or equal to &#8211; [Today]</li>
</ul>
<p>This will ensure that the view only displays Uncompleted items that  		are due in the next 7 Days but are not Overdue.</p>
</td>
<td><a href="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-coming-due.gif"><img class="aligncenter size-full wp-image-55" title="adv-filter-coming-due" src="http://blog.pentalogic.net/wp-content/uploads/2008/10/adv-filter-coming-due.gif" alt="Set the filter" width="343" height="301" /></a></td>
</tr>
</tbody>
</table>
<h3>Items due in the current Calendar Month</h3>
<p>If you need to filter for a Calendar Week/Month (rather than a rolling 7/30 day period) then this post details how</p>
<p><a href="http://blog.pentalogic.net/2009/11/howto-filter-items-current-calendar-month-view-sharepoint/">How To Use Filters in SharePoint to show items in the current Calendar Month</a></p>


<p>Related posts:<ol><li><a href='http://blog.pentalogic.net/2010/06/how-to-setup-sharepoint-view-filter-to-compare-2-list-fields/' rel='bookmark' title='Permanent Link: How To setup a SharePoint view filter to compare 2 list fields'>How To setup a SharePoint view filter to compare 2 list fields</a> <small>SharePoint workaround to create a list view based on a...</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/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/10/advanced-sharepoint-view-and-filters/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
	</channel>
</rss>
