Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cal avg by month

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Hi all,

Have a Date field and do a count of and the other db field.

Using CR 8.5ver, Grouped by date field(to show for each day) and doing a total by each month, I need to do a average for the total different count of status

average = month total/number of days in that month


Sample of my rpt it should look like:


Date Stat1 Stat2

09/02 4 6
09/05 1 4
09/20 3 5
09/25 1 0

total 9 15
avg 9/30 15/30 since sept has 30 days if it was oct then divide by 31

How do I do this

I have tired by do a formula and check for each month then divide by the number of days and didn't like it. Any best way to do this

Thanks in advance,
Sweetie
 
What does "check for each month then divide by the number of days and didn't like it" mean? You didn't like it, or?

To get the days of a month use:

day(dateserial(year(currentdate),month(currentdate)+1,1)-1)

Substitute your date field for the currentdate.

-k
 
Thank you "K". It worked and looks simple now. Before I made it complicated myself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top