Forums

average all records

marklandry 18 Jul, 2011
Hi,
I have an SQL statement that works in phpmyadmin, but don't know how to translate this into cc:

SELECT AVG( text_0 )
FROM `jos_chronoforms_skills_star`
WHERE `cf_user_id` =62

Which gives me an average of all records in the "text_0" column

I've tried some different things but am stumped since I can't use "select" in the "where" box

I've also looked all over the cc forum but can't seem to find anything

Anyway, thanx for your help

mark
GreyHead 18 Jul, 2011
Hi Mark,

Where do you want to use this? As it only returned a single value it isn’t much use as the main CC query . . .

Bob
marklandry 26 Jul, 2011
We have a site that collects scores for games per user.
I'd like to report to each user what the average of all of their scores is...
Does that make sense?
GreyHead 27 Jul, 2011
Hi Mark,

OK, the DB query probably has to go as a stand-alone query in the Header or Footer box. You can't easily add this to the default ChronoConnectivity query without using one of the hacked versions in the forum here.

Bob
This topic is locked and no more replies can be posted.