Newbies Jason Burds Posted March 29, 2005 Newbies Posted March 29, 2005 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.
Ender Posted March 29, 2005 Posted March 29, 2005 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.
Newbies Jason Burds Posted March 30, 2005 Author Newbies Posted March 30, 2005 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.
Recommended Posts
This topic is 7246 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now