Forum Discussion

SharonNeville's avatar
SharonNeville
Qrew Trainee
8 years ago

Comparing two workdates to return the latest date.

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?

8 Replies

  • 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.
  • 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.

  • Try this

    Max(
    ToDate([Summary 2 of Final task date completed]), ToDate([Summary of final task date completed])
    )  
  • 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?
  • 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.