Dates between the two given dates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pointers
    New Member
    • Oct 2006
    • 9

    Dates between the two given dates

    Hi,

    Can we get a SQL query, to display all the dates between two given dates
    eg. if date1=21-mar-2007 and date2=25-mar-2007
    then the query should display all the dates between those two given dates i.e
    22-mar-2007, 22-mar-2007, 23-mar-2007and 24-mar-2007.

    Query should not contain any plsql coding.

    Regards.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to use BETWEEN clause .

    Comment

    • BMantri
      New Member
      • Apr 2008
      • 7

      #3
      Hello,
      You can use col > to_date(date1, 'dd-mon-yyyy') and col <= to_date(date2,' dd-mon-yyyy') in the WHERE clause

      Comment

      Working...