Fetching Data Between 2 Dates: SQL

Home Forums Programming Fetching Data Between 2 Dates: SQL

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1389
    RoboCop
    Participant

    How to fetch records between two dates from the database using query..

    Example: Table name: company

     
    +--------+----------------+
    | name       | jd         |
    +--------+----------------+
    | Google     | 2010-02-20 |
    | Oracle     | 2010-02-15 |
    | Microsoft  | 2010-02-05 |
    | Apple      | 2010-02-02 |
    | Technotip  | 2010-02-01 |
    | ebay       | 2012-02-09 |
    +--------+----------------+
    
    #1390
    Basavaraj
    Member

    sql> select * from company where jd between ‘2010-02-01’ and ‘2010-02-15’;

     
    +--------+----------------+
    | name       | jd         |
    +--------+----------------+
    | Oracle     | 2010-02-15 |
    | Microsoft  | 2010-02-05 |
    | Apple      | 2010-02-02 |
    | Technotip  | 2010-02-01 |
    +--------+----------------+
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.