March 29, 200520 yr Newbies Hello, everyone. This is my first time in the forums, and I am fairly new to Filemaker. My boss wants me to design a simple database that can keep schedules for 4 rooms. Where I am coming into problems is on the date and time validations. I am trying to figure out how to restrict someone from entering a reservation on the same time and date as another record for the same room. If this is not the right topic for this, sorry, please point me in the right direction.
March 29, 200520 yr You'll need a self-join relationship, where the relationship is composed of Date, Time Start, Time End, and Room. It would look something like this: Reservation::Date = Reservation 2::Date AND Reservation::Time Start <= Reservation 2::Time End AND Reservation::Time End >= Reservation 2::Time Start AND Reservation::Room = Reservation 2::Room If there are related records, then there is already a reservation on that Date for that Room that overlaps the time range. You can check out the demos and discussion about trying to create recurring events with this type of system while avoiding conflicts here: http://www.fmforums.com/threads/showflat...e=0&fpart=2 Note that it's not necessary to use Smart Ranges or custom functions to do the basic range to range relationship here.
March 30, 200520 yr Author Newbies Thanks for the quick reponse. Currently I am trying to do one table for all of the rooms. Do I need to make a seperate table or even seperate file for each room? Relationships don't seem to work with the 2 tables. Customer table and the Rooms table. And on the form I can get it to popluate but it still lets me enter in the same time on the same day for the same room. Where would I put this in Reservation::Date = Reservation 2::Date AND Reservation::Time Start <= Reservation 2::Time End AND Reservation::Time End >= Reservation 2::Time Start AND Reservation::Room = Reservation 2::Room is that a script off of the accept reservation button. Sorry for being such a newbie at this. Thanks again for your help.
Create an account or sign in to comment