bgonso

It seems this question has not been answered on other threads, but I'm going to ask it again anyways.

I want to see the number of days that have passed between two dates. SharePoint designer allows me to create a calculated column, but even when modifying the xsl of the view, there is no straight forward way to derive the number of days between two dates. For example, I want to know the number of days between the Created Date and the current date ( Today() )

I'm using SharePoint 2007



Re: SharePoint - Design and Customization Number of days between two dates


Re: SharePoint - Design and Customization Number of days between two dates

Anonymous

Hi dlgross,

Thanks for the reference, however, those are formulas for adding a column within a SharePoint site, which only updates the calculated value when the item is saved.

I need to do this in the Office SharePoint designer, which will allow me to customize a list view (rather than one item). This will allow all values to be dynamic.

In addition, I'm looking to use dynamic (aka "volitile") values such as the current date (aka Today() ), which has proven to be difficult.

I need the number of days between the created date and the current date.





Re: SharePoint - Design and Customization Number of days between two dates


Re: SharePoint - Design and Customization Number of days between two dates

Anonymous

Hi Mart1n0,

The comment from a reader at the end of the blog you referenced makes the same point that I have:


------------------------------------------------

Comments

Friday, March 18, 2005 5:52 PM by rachel

# re: Using [Today] in a Calculated Formula (Birthday Lists)

That's really good advice!

I want to use this trick to create a calculated column that shows how long this list item has been created. But the formula [Today]-[Created] doesn't seem work. Any suggestion


Thanks!


rachel
-------------------------------------------------------------
Thanks for the help. It seems that the search for this answer continues...




Re: SharePoint - Design and Customization Number of days between two dates

Mart1n0

Hi

The problem with using the calculated field is that it's only calculating on creation and editing. The field isnĄ¯t refreshed when someone views the list.

See the comments in this article: http://blogs.msdn.com/cjohnson/archive/2006/03/16/552314.aspx

Mart1n0






Re: SharePoint - Design and Customization Number of days between two dates

Anonymous

Correct. This is going to be used when viewing a list view with hundreds of records, not one item after its updated.

I'm thinking that exporting the data to excel, using excel services, or creating a custom web part may be the only ways right now.

Hope this is addressed soon by the SharePoint team.





Re: SharePoint - Design and Customization Number of days between two dates

bmcmann

I was looking at the time tracking template by Microsoft today, and noticed that the site refreshes every 5 minutes in an automated manner - which got me thinking about your post.

I opened the time tracking default page in SharePoint designer and noticed a couple of things:

- there is a dateutil.js file and the following meta tag <meta http-equiv="refresh" content="300"> which the site is refreshing every 5 mintues.

Just wondering if you opened your list in SharePoint Designer, placed the javascript and the meta tag within the list you want to calculate the age if that might get you home





Re: SharePoint - Design and Customization Number of days between two dates

bgonso

Hi bmcmann,

I'd like to take a look at that dateutil.js file. Where can I find this time tracking template

- bgonso





Re: SharePoint - Design and Customization Number of days between two dates

bmcmann

the template is one of the fantastic 40 released by Microsoft.

the url is:

http://www.microsoft.com/technet/windowsserver/sharepoint/wssapps/templates/default.mspx

- ben