PDA

View Full Version : Calculate average age of board users


chris frolic
01-30-2002, 04:59 AM
I'd be curious to know the average age of my member base.

Would it be possible to calculate this?

I would think that it would also be a good idea to discard the top and bottom 5% of ages to take into account people who fill in bogus information.

Admin
01-30-2002, 05:16 AM
Here's a query that will give you the average age of your users, however it doesn't do what you said in the last paragraph:
SELECT ROUND(YEAR(NOW())-AVG(YEAR(birthday)),2) AS avgage FROM user WHERE YEAR(birthday)<>0;
(rounded to two decimal points)

Actually, I think there is already a hack for this... I think it's called User Ages in CP...?