hellismyrestingplace
KPCKevin Powell - Community
•Created by hellismyrestingplace on 4/16/2025 in #help
Sum Count Of Weekend Days In Overlapping Periods (MySQL)
I need to get a total count of all Fridays and Saturdays for all overlapping periods against my selected Checkin and Checkout dates.
Table "special_prices" structure:
The current query is using a stored function that works but I need a solution that doesn't use that but rather some raw sql approach for better performance. Current query for context (along with PHP bit):
- I can't change the table structure - having a separate row pear each special price date could solve this problem but I must use the start - end
- special_price "end" column should not be counted in the special_weekend_days
Goal is to find a way to accurately count all Fridays and Saturdays (special_weekend_days) in all overlapping periods.
411 replies