#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Unhappy Help with looking up any entries in the last day (not 24 hours)


    I need to look up any entries for a given user in the last day, note not 24 hours. I tried using DATE_SUB but keep getting no results even though there is date. The field in question is a datetime field and was created using NOW() during the record insert.

    Thanks in advance.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,178
    Rep Power
    4274
    Code:
    WHERE field_in_question >= CURRENT_DATE - INTERVAL 1 DAY
      AND field_in_question  < CURRENT_DATE
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo