Link to home
Start Free TrialLog in
Avatar of Morpheus7
Morpheus7

asked on

Groupings And Percentages

Hi,
I have a table containing the following columns:
ProdGroup,   ProductID, PercentFat, PercentProt.

I would like to be able to get the average PercentFat and PercentProt per ProdGroup.
The fields are all of type INT. There are multiple ProductIDs within each ProdGroup.

So to be able to return one row for each ProdGroup, together with the average percentage PercentFat  and PercentProt

Any assistance would be appreciated
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Phillip Burton
Phillip Burton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Morpheus7
Morpheus7

ASKER

Many thanks for your reply. If I convert to REAL, would this give me a more accurate figure?
Thanks
Yes. - Make sure you do the CAST or CONVERT inside the AVG, i.e. AVG(CAST instead of CAST(AVG(
Many thanks