Click to See Complete Forum and Search --> : records between 2 dates.


saisai84
03-02-2006, 03:11 PM
how do i retrive all the records between 2 dates from database and load it into JTable? i am using combo box to get the date input from user. The date in database is seperated into day,month and year for each column(am i doing the wrong thing?). thanks in advance!

Khalid Ali
03-02-2006, 06:49 PM
select * from tableName where startDate=> startdate AND endDate<=enddate

something along those lines will work

saisai84
03-03-2006, 01:54 AM
select * from tableName where startDate=> startdate AND endDate<=enddate

something along those lines will work
yes, i am doin like tis, but some date in between are not retrieve.
select * from table where (day>startday and month>startmonth and
year>startyear) and (day<endday and month<endmonth and year<endyear).

saisai84
03-03-2006, 02:02 AM
if i just select all the start year and end year, then all records between them will be retrive then only choose the month and day btw them. but using if and else statement?