Discussions

Expand all | Collapse all

Comparing two workdates to return the latest date.

  • 1.  Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:15
    I have a project management app that uses predecessors.  There are two possible outcomes in my workflow where I want to compare two different task completion dates and use the highest as the project finish date.  
    I created two summary fields based on my two possible task completion dates (work dates).  Then I created a formula date field to show the result of the comparison.  I was trying to use the MAX function:

    MAX([summary date 1],[summary date 2])

    I am getting a syntax error, and I have had no luck rearranging the components of the formula.  Has anyone else used MAX on work dates?


  • 2.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:22
    What is the syntax error - but aside from that, try thisd

    Max(ToDate([summary date 1], ToDate([summary date 2]))

    Maybe those summary fields are Work date field types.


  • 3.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:30

    Good Morning!

    Now the error is a mismatched set of parenthesis....

    Max(ToDate([Summary 2 of Final task date completed], ToDate([Summary of final task date completed]))  

    Yes, Both of the Summary dates are WorkDates.



  • 4.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:31
    Try this

    Max(
    ToDate([Summary 2 of Final task date completed]), ToDate([Summary of final task date completed])
    )  


  • 5.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:39
    It accepted that formula, Thank you!  However it is returning the earlier date.  One task was completed on 10-12-16 the other was completed on 1-30-17.  This field now shows 10-12-16.  Any thoughts?


  • 6.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:45
    Can you tell me what dates are in each of those two fields?


  • 7.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 13:52
    Summary of final task date completed = 1/30/17,  Summary 2...= 10/12/16


  • 8.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 14:13
    Never mind, just as I suspected, that problem is on my end.  Has to do with where they are pointed. Thank you so much for the help with the formula!  When I fix the background it should work like a charm. 


  • 9.  RE: Comparing two workdates to return the latest date.

    Posted 03-09-2017 14:22
    :)  Great.