AndyGett
Andy Gettings is the president of Bullseye Consulting which develops and manages customized SharePoint applications and other software and databases for businesses. More
Microsoft Certified Technology Specialist

Microsoft Office SharePoint Server 2007 Configuration


RSS Feed Feed your read!

Archives

July 2008 (12)
August 2008 (1)
September 2008 (1)
October 2008 (2)
January 2009 (2)
April 2009 (1)

Links

Archive
Archive (Calendar)
@AndyGett Twitter
AndyGett LinkedIn
Bullseye Consulting

Tag Cloud

Family, M4300, Recreation, SharePoint, Technology, Virtualization,

Date Formulas in SharePoint Calculated Fields 

Tags:

Microsoft provides a nice compilation of Examples of common formulas, but it does not work as advertised with WSS. I have not tried it in MOSS. Let's say there is a date column named ExpirationDate and an integer named NotificationMonths which represents the number of months before the expiration date that we want the notification in our calculated field NotificationDate.

Simple arithmetic using a date and an integer adds the number of days. If ExpirationDate is 10/31/2009, and NotificationMonths is 6, the formula

=ExpirationDate- NotificationMonths
yields 10/26/2009, but what we really want is 5/1/2009 (4/31 does not exist). The link from the first sentence of this post implies that
=DATE(YEAR(ExpirationDate),MONTH(ExpirationDate)-NotificationMonths,DAY(ExpirationDate)) 
ought to do exactly this, but instead it gives the error "The formula refers to a column that does not exist. Check the formula for spelling mistakes or change the non-existing column to an existing column."

The solution is to use braces around the field names:

=DATE(YEAR([ExpirationDate]), MONTH([ExpirationDate])-[NotificationMonths], DAY([ExpirationDate]))

 
Posted by AndyGett on 16-Oct-08
0 Comments  |  Trackback Url  |  Link to this post | Bookmark this post with:        
 

Links to this post

Comments

Name:
URL:
Email:
Comments: