Avg Member Age in Statistics?

Discussion in 'Suggestions and Feedback' started by Anti-Trend, Aug 15, 2004.

  1. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    In the Statistics section of the forum, would it be too difficult to add the average member age to the existing statistics? Not that it's very important, nor 100% accurate (people don't always put their correct BD). I just think it'd be an interesting snippet of info. :)
     
  2. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    interesting, I think I *might* be able to do this my self! though it adds a extra query to the index page!
     
  3. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
  4. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    I posted at the vb forums, I will see if I get any replies! I found a code, but gives the avg age of around 1.000 which isnt right!
     
  5. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    Hmm, I wonder if that has anything to do with people not including their birthdays at all? I wonder if those cases can be filtered out of the data set...
     
  6. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    it sure can be, but not the fake dates? not had a reply at the vbforums yet!
     
  7. harrack52

    harrack52 Supreme Geek

    Likes Received:
    5
    Trophy Points:
    0
    You can filter.

    We could even write the thing ourselves.
     
  8. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    heres the code in php/mysql

    PHP:
    // average age 
    $result=$DB_site->query_first("SELECT YEAR(NOW())-AVG(YEAR(birthday)) AS avgage FROM user WHERE YEAR(birthday) <> 0"); 
    $age=$result['avgage'];
    what it does it take the current year - the average year of birth, which should give the average age!
     
  9. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    its ok, I got it!

    Edit: Average Age: 25
     
  10. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    Nice! Hmm, the avg. age is a little older than I thought it would be. :good:
     
  11. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    yeh! but you have to consider people, who have provided a false date of birth!
     
  12. Addis

    Addis The King

    Likes Received:
    91
    Trophy Points:
    48
    yeah i put my age as 14 now. and i'm 14...now.
     
    Sniper likes this.
  13. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    thanks dude :)
     

Share This Page