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!

Help with a Calculated Field

Status
Not open for further replies.

Toga

Technical User
Jul 21, 2000
234
US
I have a table with some data that I'm trying to run some stats on. I created a query in design mode to return the Avg, Min, Max StDev, etc. That all works fine. What I need is the number of data points > than the average value and the number of data points less than the average value. Is there a way to do this, short of writing my own function that I have call.
 
SELECT Count(*) FROM ATable
WHERE SomeField >(SELECT Avg(SomeField) FROM ATable)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I can run that as a seperate query and it works fine but I can't get it to work as a calculated field in my existing "totals" query. My existing query returns Avg, Max, etc. Is there a way I can use what you suggested as a calculated control in that same query?
 
I had to work on my syntax a little more and was able to get it to work. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top