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

Exclusion of Values When Generating Averages

Status
Not open for further replies.

JerSand

Technical User
Oct 25, 2000
74
US
A table called "Main" includes twelve fields having values ranging from 1 to 3. I wish to compute an average for each field after excluding the 3s. Each record has 3s in a few fields, but the records vary regarding the fields in which their respective 3s occur. I haven't figured-out syntax that would, in a single query, include all twelve fields and all records but exclude the 3s for the computation of averages for each particular field. Were such a query possible, it would mean there would be different numbers of records underlying each field's average.

This approach in general seems to me to be a dead end, and I'd be grateful for suggestions.

Thanks.

JerSand
 
In a prelim process, replace the '3' in each field w/ Null.

Probably want to make a (temp) copy of the original table, run the update (update 3 to Null) on each field of the copy.

Do the aggregate on the copy.


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thanks for the help, MichaelRed (this, of course, is not the first time you've pointed the way). I'm grateful.

JerSand
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top