Posted by Michael Fesser on 08/02/07 08:55
..oO(newbie)
>I want to query all the orders that are placed on a particular
>month( and different month has different ending date--28, 30, 31). I
>want to have a sort of function with the following interface, is there
>an existing mysql function does that?
>Thanks.
>
>function select_order_of_month($month) {
> $sql_query = "SELECT COUNT(*) FROM `order` WHERE *I really want to
>specify the interval for the whole month here*";
>}
$sql_query = "
SELECT COUNT(*)
FROM `order`
WHERE MONTH(orderDate) = $month";
Micha
[Back to original message]
|