Hello,
I have a Crystal Report v 10.0 that has dates and the balances for that day in the detail section and it is grouped by account number and date so it looks like this:
Acct Num: 1234
9/1 1000.00
9/2 134.56
9/3 877.34
9/4 3444.44
9/8 635.78
Acct Num: 3456
9/1 1000.00
9/2 134.56
9/3 877.34
9/4 3444.44
9/8 635.78
The parameters for the report is 'StartDate' and 'EndDate' so the dates on the report are between 'StartDate' and 'EndDate'.
I want to calculate an average for the specified time period and also include weekends and holidays. For example, the average balance over the period 9/1 to 9/8 should include balances from 9/1 through 9/4, the balance from 9/4 for the weekend dates 9/5 and 9/6 and the holiday date 9/7, and the balance from 9/8.
I thought I could do this by putting a hidden field in the detail section to calculate the number of days until the next business day for each date on the report. Then I could multiply a day's balance by the number of days in this hidden field and use the results to arrive at a weighted average.
But I dont know how to calculate the next business day. I looked at some earlier posts and I can calculate the number of business days in a given date range etc. but not the next business day.
Please help.
I have a Crystal Report v 10.0 that has dates and the balances for that day in the detail section and it is grouped by account number and date so it looks like this:
Acct Num: 1234
9/1 1000.00
9/2 134.56
9/3 877.34
9/4 3444.44
9/8 635.78
Acct Num: 3456
9/1 1000.00
9/2 134.56
9/3 877.34
9/4 3444.44
9/8 635.78
The parameters for the report is 'StartDate' and 'EndDate' so the dates on the report are between 'StartDate' and 'EndDate'.
I want to calculate an average for the specified time period and also include weekends and holidays. For example, the average balance over the period 9/1 to 9/8 should include balances from 9/1 through 9/4, the balance from 9/4 for the weekend dates 9/5 and 9/6 and the holiday date 9/7, and the balance from 9/8.
I thought I could do this by putting a hidden field in the detail section to calculate the number of days until the next business day for each date on the report. Then I could multiply a day's balance by the number of days in this hidden field and use the results to arrive at a weighted average.
But I dont know how to calculate the next business day. I looked at some earlier posts and I can calculate the number of business days in a given date range etc. but not the next business day.
Please help.