Need to make rental unavailable if rented already

I have a booking app and I need to be able make it so you cannot book the unit if it’s already booked.

I’m writing the expression in the [Check In] column of the Rental table and [Room Selected] is a virtual column

AND(
[Check in Date]<[Check out Date],
ISBLANK(FILTER(
“Rooms”,AND([_THISROW].[Room Selected].[ID]=
[_THISROW].[Room Selected].[ID],
[Check in Date]<[_THISROW].[Check out Date],
[_THISROW].[Check in Date]<[Check out Date],
[_RowNumber]<>[_THISROW].[_RowNumber])
))
)

My result is i’m unable to book any unit anytime now

AND([Check in Date]<[Check out Date],
ISBLANK(FILTER(“RENTAL”,
AND([Room].[ID]=[_THISROW].[Room].[ID],
[Check in Date]<[_THISROW].[Check out Date],
[_THISROW].[Check in Date]<[Check out Date],
[_ROWNUMBER]<>[_THISROW].[_ROWNUMBER]))))

I had the wrong Table being filtered My bad It’s working now.

I just need to add the Time of rental in now so it’s available at check in time of 3pm same day as checkout time of 11Am

2 Likes