I don't know how to explain exaclty but what I'm trying to say is that the Php will display the data from the database.
The reports that I mean is that my database name
Actually this is my sample program before.,the ouput of this is that I need to dispaly in a browser.,and i dont' know ho. 🙁
SELECT RestaurantMaster.RestaurantCode, RestaurantMaster.RestaurantName,
SUM(CASE WHEN OrdersHistory.GrossTotal < '100' THEN OrdersHistory.GrossTotal END) AS '100 & below',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '100' AND OrdersHistory.GrossTotal < '200' THEN OrdersHistory.GrossTotal END) AS '101-200',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '200' AND OrdersHistory.GrossTotal < '300' THEN OrdersHistory.GrossTotal END) AS '201-300',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '300' AND OrdersHistory.GrossTotal < '400' THEN OrdersHistory.GrossTotal END) AS '301-400',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '400' AND OrdersHistory.GrossTotal < '500' THEN OrdersHistory.GrossTotal END) AS '401-500',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '500' AND OrdersHistory.GrossTotal < '600' THEN OrdersHistory.GrossTotal END) AS '501-600',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '600' AND OrdersHistory.GrossTotal < '700' THEN OrdersHistory.GrossTotal END) AS '601-700',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '700' AND OrdersHistory.GrossTotal < '800' THEN OrdersHistory.GrossTotal END) AS '701-800',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '800' AND OrdersHistory.GrossTotal < '900' THEN OrdersHistory.GrossTotal END) AS '801-900',
SUM(CASE WHEN OrdersHistory.GrossTotal >= '900' AND OrdersHistory.GrossTotal < '1000' THEN OrdersHistory.GrossTotal END) AS '901-1000',
SUM(CASE WHEN OrdersHistory.GrossTotal > '1000' THEN OrdersHistory.GrossTotal END) AS '1001 & up'
FROM OrdersHistory
JOIN RestaurantMaster
ON OrdersHistory.RestaurantID = RestaurantMaster.PKID
WHERE
YEAR(OrdersHistory.OrderDate) = 2011
AND month(OrdersHistory.OrderDate) = 10
--AND day(OrdersHistory.OrderDate) = 11
AND OrdersHistory.StatusFKID = 2
--AND (DATEPART(HOUR,OrdersHistory.OrderDate) >= 0
--AND DATEPART(HOUR,OrdersHistory.OrderDate) < 6)
GROUP BY RestaurantMaster.RestaurantCode, RestaurantMaster.RestaurantName
ORDER BY RestaurantMaster.RestaurantCode, RestaurantMaster.RestaurantName;