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.
Loading
Suthish NairPosted Mar 16, 2011, 4:29 PM
Jaganathan BantheswaranPosted Mar 16, 2011, 6:46 AM
Just try like this
select intime as InD,outtime as OutD from tbl_attendance
where intime > TO_DATE('03/1/2011', 'MM/DD/YYYY') and intime < TO_DATE('03/05/2011', 'MM/DD/YYYY')
VulpesPosted Mar 16, 2011, 6:13 AM
Elizabeth RaniPosted Mar 16, 2011, 6:09 AM
Thanks for the query but i have tried the sane query but this is also showing the same result. their is no change in the result. Is their any other way to retrieve the result.
Any help would be highly appreciated.
VulpesPosted Mar 16, 2011, 6:06 AM