46
Views
7
Comments
About Database filters
Application Type
Traditional Web

i am creating an online hotel booking demo. I am stuck with how to filter room that are empty and not reserved on a particular date. This is my database schema below. You are welcome to point out my mistakes. I am here for learning.

Capture.PNG
2021-06-02 20-50-04
Márcio Carvalho

Hello there,

So I saw that you have an attribute to say if your rooms are available or not, maybe you can use that to see if is available or if has a reservation, and you can even give a double check by filtering through the reservation table.

So also what I think you need to do, is, filter all rooms that are not reserved on that date relative to DateIn and Date Out.

Can you share your OML?

Kind Regards,

Márcio

UserImage.jpg
DEEPAK B

Hi Marcio,

Please check oml and suggest some solutions.

FourSeasonsCore.oml
2021-08-12 05-19-40
Shubham Janbandhu

Hy Deepak,

Got your point. You can you this filter in aggregate "(RoomRecord.IsAvailable = True) and (Reservation.DateIn <> OccupiedRoom.CheckIn)" . For empty room you can use before "and" statement, after "and" I also have confusion. Sharing screenshot. Please let us know its working or not.

Regards,

Shubham 

Demo.png
2021-05-13 04-25-29
Vinay Jangam

Hi Deepak,

I have shared my oml kindly refer

HotelBooking.oml
2021-05-13 04-25-29
Vinay Jangam

CS File

HotelBookingCS.oml
UserImage.jpg
DEEPAK B

Thanks Everyone for your precious time and solutions.


2021-08-12 05-19-40
Shubham Janbandhu

Hi Deepak, 

have you get your solution. And if, can you marked as solution so this case will mark as solved.

Thank you.

Shubham

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.