August 14th, 2000, 06:53 PM
I want to do the following, I want to make a selection of everything added to my dbase in the last week. I have a date field, called dte and it's format is Y-m-d, when I do a query for that date the reply is something like 2000-08-15. Can anybody help me make the query so that I only get the files that were added last week???
Thanks a lot in advance!!
August 14th, 2000, 07:19 PM
$sql = "SELECT * from table where DATE_ADD(my_date_feild, INTERVAL $backdate day) >= DATE_FORMAT(now(),'%Y-%m-%d')";
my_date_feild = the date feild in my table
$backdate = the number of days we're interested in (in this case 7)
August 14th, 2000, 08:00 PM
Thanks a lot!!!!!!!!!!! It works like a charm!