SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question INTERVAL & BETWEEN issue

    Hello Guys

    Please help me..

    I have a table `tbl_users_logos with fields id, create_date(timestamp), .....

    I wana to get those records added on previous fith day not less not more only - 5 day.


    Thanks in advance.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Code:
    SELECT id
         , create_date
      FROM tbl_users_logos 
     WHERE create_date >= CURRENT_DATE - INTERVAL 5 DAY
       AND create_date  < CURRENT_DATE - INTERVAL 4 DAY
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •