SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2004
    Location
    london
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL: the opposite of "SELECT now() -interval 1 day"

    Hi there, if i run

    Code:
    SELECT now() -interval 1 day
    I get all items within the last 24 hours. How would I reverse/adjust this so that i get everything that ISNT in the last 24 hours ?

    any help on this would be greatly appreciated

    Cheers

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,501
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    If you run that query, you'll get an error. There is no table
    I think you have that piece in the WHERE clause?

    Why don't you post the entire query?

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,087
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    You didn't give any info on the column and/or table name, but you need something like
    Code SQL:
    SELECT
      something
     , anything
     , just_stay_away_from_the_evil_star
    FROM
      my_table
    WHERE
      DATE < CURRENT_DATE - INTERVAL '1' DAY

    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •