i have some where clause like:
$sWhere = " WHERE MONTH(Inspection_datetime) = '".$Month."' AND
YEAR(Inspection_datetime) = '".$Year."' ";
and another command:
WHERE DAY(Inspection_datetime) BETWEEN 8 AND 14
GROUP BY Line, WEEK(Inspection_datetime), YEAR(Inspection_datetime)
how do i do to combine both command become one? because i want to show data in the second week and sort them in selected Month and Year.
Simply add another AND clause to your statement.
" MONTH(Inpsection_datetime) = '".$Month."' AND YEAR(Inspection_datetime) = '".$Year."' AND WHERE DAY(Inspection_datetime) BETWEEN 8 AND 14 GROUP BY Line, WEEK(Inspection_datetime), YEAR(Inspection_datetime)";