Skip to content
Advertisement

Finding double bookings

I have two tables which when linked by a booking ID from table 1 and ID from table 2

Therefore

Im trying to flag double bookings where the same member id has booked twice within a time frame (StartDateTime and EndDateTime). Then remove the booking that has the latest BookedDate.

Can someone help me with a sql script for this?

Hope that makes sense.

Thanks in advance

Ian

Advertisement

Answer

If I understand correctly, you need the member id from the first table and then you are just looking for overlaps:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement