Oldest / youngest user on my board?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wachtmeister
    Member
    • Apr 2004
    • 91
    • 3.6.x

    Oldest / youngest user on my board?

    Hello,

    maybe someone did this before... I would like to know which are my oldest and my youngest users. I cannot sort the userlist this way and someone told me, that i need a query.

    Does someone has this query into his pocket right now?

    Regards, Wachtmeister
    Stromspar-Suchmaschine
    Theken & Tresen


  • Lats
    Senior Member
    • Mar 2002
    • 3671

    #2
    Try these...

    Youngest:
    Code:
    SELECT 
        username, 
        birthday_search, 
        year( current_date ) - year( birthday_search ) AS age
    FROM 
        user
    WHERE 
        year( current_date ) - year( birthday_search ) < 18
    AND
        year(birthday_search) > 1900
    AND
        year(birthday_search) < 2010
    ORDER BY
        age ASC
    Oldest:
    Code:
    SELECT 
        username, 
        birthday_search, 
        year( current_date ) - year( birthday_search ) AS age
    FROM 
        user
    WHERE 
        year( current_date ) - year( birthday_search ) > 40
    AND
        year(birthday_search) > 1900
    ORDER BY
        age DESC
    Lats...

    Comment

    • Wachtmeister
      Member
      • Apr 2004
      • 91
      • 3.6.x

      #3
      Great !

      THANK YOU
      Stromspar-Suchmaschine
      Theken & Tresen


      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎