The BETWEEN funtion
Posted: Fri Mar 19, 2004 8:54 am
I have this query which add up the ammout spent in petty cash between two dates
From what i can see, BETWEEN returns all the figures between the two dates not including the to date.
How can i get bwetween and including?
Thanks
Mark
Code: Select all
// Date the petty cash system started
$startOfCashDate = "2003-10-01";
// The date of the end of last month
$endoflastmonth = $last_year."-".$last_month."-".$lastday."";
$sql = "SELECT SUM(debit_amount) FROM petty_cash WHERE date_spent BETWEEN '$startOfCashDate' AND '$endoflastmonth'";How can i get bwetween and including?
Thanks
Mark