August 28, 200322 yr I want to calculate the ninimum and maximum value on a date field (earliest and latest date) of a set of records. I created two global fields and have a script that set this fields one with the max(field) and the other with the min(field) function. The problem is that when the script is run, it sets both fields with the minium value (earliest date). Does anybody knows how to make it work? thanks.
August 28, 200322 yr The problem is that Max(date) or Min(date) is only going to return the date itself. You need a constant self-relationship (i.e. either a constant field related to itself or a global field related to a constant of 1) to compare all records in the file. And you need more complications to calculate this for only the currently found set of records. Why not take an easier route and just sort by the date, go to first record and set the minimum field, then go to the last record and set the maximum? Either that or use summary fields, if you only want to display the data and need not perform any calculations with it.
Create an account or sign in to comment