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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Statement - Average of Max

Status
Not open for further replies.

mrichey

MIS
Nov 22, 2002
71
US
I'm using the statement below to pull out the MAX CPU reading fom the hourly tests for each day in August. Is there any way to alter the statement to see the average of the MAX's for each server in August? I'm using crystal reports and I'm having to insert an AVG summary on the MAX"TIV_AGG"."W.PCENTPROCTIME"" field. Because that is a 2nd pass function, I can't chart on it. Any suggestions appreciated.

SELECT "TIV_AGG"."S_DATE", "TIV_AGG"."SERVER",MAX ("TIV_AGG"."W_PCENTPROCTIME")
FROM "TIVOLI"."TIV_AGG" "TIV_AGG"
WHERE "TIV_AGG"."S_DATE" BETWEEN '20040801' AND '20040831'
GROUP BY "TIV_AGG"."S_DATE", "TIV_AGG"."SERVER
 
When I look at your query, it looks like you are pulling the maximum value of the hourly tests for EVERY DAY in August, not EACH DAY in August, am I correct?

Anyways, I think what you want it the aggregate functions using the GROUP BY clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top