Hi,

This query counts the number of entries in the Bookings table per month, is 
it possible for this query to return a zero where there are no entries for a 
particular month?

SELECT COUNT(Booking_ID) AS "Num_Bookings"
FROM Bookings
WHERE User_ID = 1
AND Work_Type_ID = 12
AND DATE_FORMAT(Booking_Start_Date, "%m-%Y") >= "04-2005"
AND DATE_FORMAT(Booking_Start_Date, "%m-%Y") <= "06-2005"
AND Booking_Type = "Booking"
GROUP BY MONTH(Booking_Start_Date)
ORDER BY Booking_Start_Date

Thanks for your help. 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to