Diff between Custom dates

M

Michael Cook

I want to show the number of days between two dates ie
Custom date(6) and Custom Date(8)as duration(1) in a
column. I Have been trying to use formula "DateDiff
(interval,date1,date2)". What is the interval if you want
the difference in days? Do you paste the field for date(6)
and Date(8) into the formula as date1,date2.

I am using Project 2003

Would appreciate any help/advice
 
J

JulieS

Hi Michael,

I did not have great sucess using a custom duration
column for the formula, however a number field worked
fine.
The formula is:
DateDiff("d",[Date6],[Date8])

Hope this helps.
Julie
 
J

John

Michael,Julie,
Like some other custom fields, the duration fields perform a conversion
to put the data into the proper data type. For the spare duration
fields, the conversion is based on the setting under
Tools/Options/Schedule Tab - "duration entered in".

By using the DateDiff formula a couple of things are occuring. First,
this formula calculates the difference in calendar days, not working
days. Second, if the option setting for duration is "days" (default) and
and interval of "d" is used in the DateDiff formula, the duration field
will assume the data given to it is in minutes and will divide by 480
(minutes in a normal working day) to convert to days. However, the "d"
interval in the formula has already converted the minutes to days so a
double conversion occurs. To compensate, simply multiply the result by
480. For example the formula should be:
Duration1 = DateDiff("d",[Date6],[Date8])*480

The reason Julie was successful when using a spare number field is that
no conversion is applied to spare number fields.

However, if you want the formula to calculate working days, then the
following formula should be used:
Duration1 = ProjDateDiff([Date6],[Date8],calendar)

If calendar is left out, the default will be the active project calendar.

Hope this clarifies things a bit.
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top