Asked by:
Project Server 2010  Date Difference formula issues  Datediff or ProjDateDiff
Question

Hi, we are using Project Server 2010. I am trying to do what I think will be a simple formula but can't seem to get it to work. I am trying to determine the difference in days between today's date and the date that a schedule was last published to the server. (I would prefer working days, but at this point will accept calendar days since working days doesn't work for me). My goal is two step  one, to get the formula to give me a day count and then to use that count in a filter in the view.
For example, if today is 3/30/2011 and a schedule was published 3/24/2011, I expect the formula to tell me that the number of days different is 6 calendar days, or 4 working days. However, I get the following results.
Formula 1: (DateDiff("d", [Last Update], Date())) which is project level, text formula results in: 23
Fromula 2: (DateDiff("d", [Last Update], Date())) which is project level, number formula results in: 23
Formula 3: ProjDateDiff([Published Date], [Todays Date], [Project Calendar]) which is project level, text formula results in: 8160 (dividing 8160 by 480 [for 8 hours by 60 minutes] I get 17, which is wrong as well.
How should this formula be written?
All replies

Date()[Last Update] is enough to calculate calendar days difference. ProjDateDiff([Published Date], [Todays Date], [Project Calendar]) may be groviding teh correct answer depending on what working days there are in the calendar and the date the formula is run.
Rod Gill
The one and only Project VBA Book Rod Gill Project Management 
I am trying to create a similar formula using MS Project Server 2007, but all attempts have failed. We require that our projects be published weekly, so I want a formula that will calculate the difference between 'today's date' and the Last Published date, and flag the project as "Past Due" if the result is greater than 7 elapsed days or 5 working days. The field reference for today's date in MS Project is [Current Date], but MS Project Server 2007 does not seem to recognize this field value. My attempts to find examples or the correct formula syntax have been fruitless, and the reply to the question above has done nothing but further confuse me...
Is it possible to write a formula that will do what I've described here, and if so, can ANYONE provide me with the correct formula??? Every 'expert' I have asked does not seem to have an answer...

cq987789,
I am calculating the exact same thing (in calendar days) on one of my reports. Try this formula and see what it comes up with...
=DateDiff("d",Fields!ProjectModifiedDate.Value,Today())
Hope this works!!
 Proposed as answer by Daren (DJ) Johnson Friday, October 14, 2011 2:39 PM