Check date range

0
I have database that contain (Start time and End time ) 09.00  15/03/2023 – 11.00 15/03/2023  and i have to check new input user that duplicate with that time? Example my new user input 08.00 14/03/2023  – 18.00 16/03/2023 and it will return false. My old algorithm check date point with date point. check old start time wth new start time and old end time with old end time. It so many coditions check in loop. and i think it will make my application slow.  Could i check in date range ? 
asked
2 answers
1

I think you have to do two XPath retrieves. First retrieve all the startdates that are greater or equal then the new input startdate and are smaller or equal then the new input end date. If any can be found then you already have a hit and can return true. But if it is empty you also have to do that same check but then retrieving all the enddates. Only if both are empty you can return false.

Regards,

Ronald

 

answered
0

How to write xpath that can get old and new from only ReservationRoomList to check overlap?

answered