Jump to content

mstoehr

New Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mstoehr

  • Rank
    Newbie
  1. WOW so simple Thank you works great
  2. I'm trying to get dates out of the DB for an overtime system. The dates are for staff with the oldest seniority first to the newest staff last. But when 2 or more people start on the same date. I need to randomly order them every time i make a query to the DB In my database, there is a column called start_date. I need to select all the dates in order of oldest date to newest date. $sql = "SELECT * FROM staff ORDER BY start_date DESC"; That's easy BUT... If there are 2 or more of the same start dates selected those dates in random order OUTPUT Example: 1988-01-01 <-- oldest date 1988-02-02 1990-01-01 1990-05-05 2000-01-01 <-- these 3 in random order 2000-01-01 <-- these 3 in random order 2000-01-01 <-- these 3 in random order 2000-02-05 2005-12-12 2006-02-02 <-- these 5 in random order 2006-02-02 <-- these 5 in random order 2006-02-02 <-- these 5 in random order 2006-02-02 <-- these 5 in random order 2006-02-02 <-- these 5 in random order 2010-05-09 2019-01-14 <-- newest date etc
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.