Car Rental App: Search For Available Cars Within Given Date & Time Range

You could do something like this:

  • In your Bookings table, create two Single Value columns, one to take each of the DateTime values from your Search table.
  • Next create an if-then-else column as follows:
    – If Single Value PickUp Time is after Booked DropOff Time, then null (leave empty)
    – If Single Value DropOff Time is before Booked PickUp Time, then null
    – Else true
  • The above column should return true (checked) for any bookings that overlap with the selected date range
  • Now in your Vehicles table, create a Query column that targets your Bookings table and uses the following filter conditions:
    – Vehicle is This Row → Vehicle, AND
    – if-then-else column is checked
  • You should then be able to use the state of that query column as a filter for your Vehicle list (only show Vehicles where the query is empty)
2 Likes