Difference between two date RRS feed

  • Question

  • Greetings,

    I need the difference between two date in the unit [days]:

    Date1 = ActiveProject.ProjectStart
    Date2 = t.Start


    Day Start=8:00; Day End=17:00; Break: 12:00-13:00; HouresPerDay=8
    Date1= 1. Jan. 2014 8:00
    Date2= 3. Jan. 2014 12:00  ==> Difference is 2.5 days

    Day Start=8:00; Day End=18:00; Break 10:00-16:00 HouresPerDay=4
    Date1= 1. Jan. 2014 9:00
    Date2= 3. Jan. 2014 18:00  ==> Difference is 2.75 days

    Exist here a function in MS-Project VB.NET?

    Is there a function in MS-Project, which also takes the settings in the parameter?

    Thank you!


    Monday, August 18, 2014 3:41 PM


  • Michael,

    For the date difference method is the same as it is for VBA. Depending on whether you want working days or calendar days, the methods are:

    Difference in working days:

    Application.DateDifference(StartDate, FinishDate, Calendar)

    Difference in calendar days:

    DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])

    You can also use these same formula in a custom field in Project.

    Hope this helps.


    Monday, August 18, 2014 4:40 PM