1- Obtain the numeric value of OderDate for the first line (line 0) of the table Orders.
obs: numeric value of a date is the number of days that past since 1/1/1900.
obs: line -1 is the last line of the table.
2- Obtain the numeric value of the first OrderDate plus line number of the Autogenerate table
obs: The Autogenerate table (DateField) will have the number of days between max OrderDate and min OrderDate
3- The Date of this number
4- number of days between max OrderDate and min OrderDate
5- InYeartoDate function with the third parameter: 0, is a boolean that return if those dates are in the same year.
obs: after the fuction use * -1 because for the fuction true : -1 and false : 0
obs: if the third parameter is -1 compare with the last year of the second date