### Title

Calculation problem

### Post

I have a daily mileage field. I have created a sum field for that and can do a find to get the total for every 7 day period. Is there a way to to create a calculation field or a script that will give me a total for every 7 day period? You must also know that there is not a record for every day of the 7 day period.

Thanks

There are several ways to do this - but all require a field with a common value for all records in the same period. You could use a calculation field (result is Date) along the lines of =

YourDate - DayOfWeek ( YourDate ) + 1

(this assumes your period is a week starting on Sunday)

Once you have that, you can define a sub-summary part based on the common date. Place your summary field in this part abd sort the records by the common date field.

Another option is to define a self-join relationship matching on the common date, and using another calculation = Sum ( related::mileage ) to get the weekly total.