I have a table of sprint info for multiple engagements, including the sprint start and end dates as separate fields. I understand how to determine if a date is within those start and end dates--in this case, to show if a holiday falls within a given sprint.
I am struggling with how to do the above by accessing a table of holiday dates--I can't figure out how to do the JOIN or use other commands so the comparison will look at every date in both tables.
Table 1 - Holidays
| Short Date | Holiday | Country |
|---|
| New Year's Day | Mexico |
| New Year's Day | Brazil |
| Constitution Day | Mexico |
| Carnival | Brazil |
Table 2 - Sprint Info
| Sprint | Start Date | End Date | Holidays |
|---|
| Sprint 1 | | 13 Jan 2023 | |
| Sprint 2 | | 27 Jan 2023 | |
| Sprint 3 | | 10 Feb 2023 | |
| Sprint 4 | | 24 Feb 2024 | |
I would like to compare Table 1 to Table 2 and indicate in Table 2 "Holidays" the number of holidays that occur on or between the Start Date and End Date.
A simple count of number of occurrences is the basic need. Extra credit to show how to indicate holiday count by country, resulting in something like this:
| Sprint | Start Date | End Date | Holidays |
|---|
| Sprint 1 | | 13 Jan 2023 | 1 Mexico 1 Brazil |
| Sprint 2 | | 27 Jan 2023 | 0 |
| Sprint 3 | | 10 Feb 2023 | 1 Mexico |
| Sprint 4 | | 24 Feb 2024 | 1 Brazil |