I generate an Excel using an SQL query per each day:
SELECT COUNT(res_id) as TotalReservation
FROM bup_vw_res_reservation
WHERE res_deleted = 0
AND DATEPART(DAY,res_date_start) = 1
I execute this Query each time I want to change the DAY. To generate 1 sheet in my Excel file, I need to open and close 30 connections in my page. And if I need to make another sheet for a different company ,then I need to execute the same 30 query again. And the page becomes extremely slow 🙁
Is there another way to get the same result in 1 query ?
If you need the total, you could do
If you need each reservation count for each day, do this