I have a form that is attached to a SharePoint Online list. In the form, two of the fields the user is being asked to fill out are "Start Date" and "End Date," and these get populated back to SharePoint when submitting the form. This part is working.
I added a gallery connected to the SharePoint list itself in the form, and I'm trying to filter this to show line items where the Start Date and/OR End Date being specified in the form fall between the start/end dates of existing entries in the SharePoint list. In other words, I'm trying to show people conflicts. "Pick another date because there is some kind of overlap with these existing line-items in the SharePoint list." So for example, if there's an existing entry in SharePoint where Start Date = 8/1/22 and End Date = 8/5/22, and I go to submit a new form with Start Date 8/3/22 and end date 8/7/22, that existing entry in SharePoint should show up in the gallery since there's overlap (not exactly the same, but there's some overlap). However, nothing I do seems to work. It's filtering, data shows up, but it's filtering incompletely. I've tried every logic combo I can think of any nothing seems to work. I need it to show all items from the SharePoint list where ANY PORTION of the date-range being requested on the form conflicts with any entries already existing in SharePoint.
Here's the logic that to me, should work but isn't. Maybe it's something obvious because I've been staring at this for a couple of days and my eyes are starting to go blurry.
Filter
(Reservations,
(
(DateValue(NewResStartDate.SelectedDate) >= DateValue('Reservation Start') && DateValue(NewResStartDate.SelectedDate) < DateValue('Reservation End'))
Or
(DateValue(NewResEndDate.SelectedDate) > DateValue('Reservation Start') && DateValue(NewResEndDate.SelectedDate) <= DateValue('Reservation End'))
)
)
The "NewRes..." ones are the form fields and the "Reservation..." ones are the SharePoint fields.
Basically the logic as I see it is:
Show entries where ("form start date" is gt= to SharePoint.Start and lt SharePoint.End) OR ("form end date" is gt to SharePoint.Start and lt= SharePoint.End)