Announcement

Collapse
No announcement yet.

average age

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • average age

    I posted at vb.org but not had a reply yet so if anyone can help? please do!

    I want the average age for my members! this is the code I found at http://www.vbulletin.org/forum/show...ght=average+age for vb2 I think?

    PHP Code:
    // average age
    $result=$DB_site->query_first("SELECT YEAR(NOW())-AVG(YEAR(birthday)) AS avgage FROM user WHERE YEAR(birthday) <> 0");
    $age=$result['avgage']; 
    thanks for the help

  • #2
    I would like this as well, thanks.

    Comment


    • #3
      You can use this query...
      Code:
      SELECT format(year(now()) - avg(right(birthday, 4)) , 2) AS Avg_Age
      FROM user
      WHERE right(birthday, 4) > '0000'
      Lats...

      Comment


      • #4
        Thanks

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X