Hi
Can you please tell me why this works:
$customer_data_date14daysAgo = mysql_query("SELECT COUNT(*) AS count
FROM tableName WHERE datetime BETWEEN '$date14daysAgo%' and
'$dateToday%' ") or die(mysql_error());
But this doesn't?
$customer_data_date30daysAgo = mysql_query("SELECT COUNT(*) AS count
FROM tableName WHERE datetime BETWEEN '$date30daysAgo%' and
'$dateToday%' ") or die(mysql_error());
PHP:
$dateToday = date ( 'Y-M-d', strtotime ( '-0 day' . $date ) );
$date14daysAgo = date ( 'Y-M-d', strtotime ( '-14 day' . $date ) );
$date30daysAgo = date ( 'Y-M-d', strtotime ( '-1 month' . $date ) );
$dateToday = 2010-Oct-28
$date14daysAgo = 2010-Oct-21
$date30daysAgo = 2010-Sep-28
The only difference is that the second query spans the Sep - Oct barrier.
If I set the date manually to 2010-Oct-01 until today - it works
But if its 2010-Sep-30 until today - it stops working
Thank you!