Elizabeth Rani

Elizabeth Rani

  • NA
  • 5
  • 9.7k

select all dates between two dates

Mar 16 2011 5:53 AM
Hi,

How can we select all dates between from date and to date using sql? There are only 2 date fields in the tables such as from date and to date

For example, given the from date 03/1/2011 and the to date 03/5/2011 I want to return:

03/1/2011
03/2/2011
03/3/2011
03/4/2011
03/5/2011


My query is

select intime as InD,outtime as OutD from tbl_attendance where intime between '03/1/2011' and '03/5/2011'

Result:
03/1/2011
03/2/2011
03/3/2011
03/4/2011

Any help would be highly appreciated.

Answers (5)