Expand my Community achievements bar.

Display Earliest and Latest Date from Set of Dates

Avatar

Level 2

The form I am working with in ES4 has a dynamic table with the ability to (1) add rows  - lets call these master rows-  and (2) add rows within a subform on each of those master rows - lets call these child rows.  Each of the child rows within a master row contain dates.  I would like to calculate the Sum of the number of dates between the earliest and latest dates specified in the child rows date fields for each master row. 

How would I go about having ES4 look for the earliest and latest dates?  Any scripting ideas?


Thanks in advance!

2 Replies

Avatar

Level 2

Was thinking perhaps using formcalc Max( ) and isoDate2Num( ) conditions may work, however I've had trouble wrapping my head around how it would work in a dynamic table. 

Avatar

Level 2

Hi redbaron07 ,

I guess that collecting the dates (in the specific column) in an array and then count the items should provide the information you Need. If you need information about the first and last date, just sort the array (ascending or descending). I don't know if this is the right way to do it, but I would give it a go (though I cannot give you the JavaScript or formcalc code, as I am not that firm in coding )

Regards

Dietmar