hello everyone,
I have a problem with displaying records between two dates.Below is my designing page:
start date: combobox of month(smonth) & combobox of year(syear)
end date : combobox of month(emonth) & combobox of year(eyear)
I want the records between this month and year.i have written the below query for that:
suppose,
smonth=01,emont h=08,syear=2000 ,eyear=2005
$q1="select transaction_id from transaction_mas ter where month BETWEEN '$smonth' AND '$emonth' and year BETWEEN '$syear' AND '$eyear'";
But with this query it is not displaying the record of 11/04/2004(mm/dd/yy).
i have used the below query also for that purpose:
$d1='01';
$d2='31';
$date1=$smonth. "/".$d1."/".$syear;
$date2=$emonth. "/".$d2."/".$eyear;
$sql="select distinct charity_id from transaction_mas ter where redeem_date BETWEEN '$date1' AND '$date2'";
But it displays the whole records of that table.
Please suggest me the solution of this problem.
please help me on this.
Thanks in advance.
I have a problem with displaying records between two dates.Below is my designing page:
start date: combobox of month(smonth) & combobox of year(syear)
end date : combobox of month(emonth) & combobox of year(eyear)
I want the records between this month and year.i have written the below query for that:
suppose,
smonth=01,emont h=08,syear=2000 ,eyear=2005
$q1="select transaction_id from transaction_mas ter where month BETWEEN '$smonth' AND '$emonth' and year BETWEEN '$syear' AND '$eyear'";
But with this query it is not displaying the record of 11/04/2004(mm/dd/yy).
i have used the below query also for that purpose:
$d1='01';
$d2='31';
$date1=$smonth. "/".$d1."/".$syear;
$date2=$emonth. "/".$d2."/".$eyear;
$sql="select distinct charity_id from transaction_mas ter where redeem_date BETWEEN '$date1' AND '$date2'";
But it displays the whole records of that table.
Please suggest me the solution of this problem.
please help me on this.
Thanks in advance.
Comment