balooka Posted March 14, 2003 Posted March 14, 2003 Hi, On my calendar solution users can put in the starttime of a session and the duration of that session. The endtime is easily calculated from that. What I need is : when a new appointment is added for a user (multiuser solution), it should verify that the appoinment is not made while that user is in a session. If teh starttime is 12:00:00 and the duration is 01:00:00 the user should not be able to make a new appointment prior to 13:01:00 (that minute I'll calc away later). Is there a way to verify a field using a timerange? I could use a find request in the lineitem but that would not speed things up, and i rather see it happening on the fly. Any hints on that? TIA JP
balooka Posted March 15, 2003 Author Posted March 15, 2003 Me again - I've been trying to figure this out but it seems even more difficult than I thought it would be. Performing a findrequest looking for a certain range isn't hard to accomplish, however I'm not searching for a range in a set of dates/times but rather for 'ranges per record'. The only idea I have left now is too create a field which hold all possible times in a field that then will be a searchfield. Something like: starttime 12:00:00 duration : 01:00:00 endtime : 13:00:00 (calc) Range in the new field: 12:01:00 12:02:00 12:03:00 12:04:00 etc ... looping until 12:59:00 is set ... but this would create kinda massive fieldpopulation when the duration is, lets say, 5 hours. There has to be another (read simpler) way to do this... any thought of the guru's here might help me out alot TIA JP
Lee Smith Posted March 15, 2003 Posted March 15, 2003 I'm pretty sure I'm *not* understanding what you are wanting. But, could this be as simple as; Find Start Time >12:00:00 and Duration =1:00:00 Lee )
Chuck Posted March 15, 2003 Posted March 15, 2003 Check out this URL: http://www.onegasoft.com/tools/smartranges/ There's a lengthy article there about creating relationships of ranges, such as dates and times. This might be the solution for you. Create a relationship between two time ranges: the proposed time and the times that are already blocked for a user. If the relationship is valid, then they can't block out the proposed time. See if it helps. It's a complicated technique, but it's well worth it. I recently used the technique to create relationships of date ranges and it works like a charm. You don't even really have to understand how it works (although I found the topic of why the technique works quite interesting). You can simply copy and paste the calculations if you just want to get the relationships to work. Chuck
Lee Smith Posted March 15, 2003 Posted March 15, 2003 Hi Chuck, JP just wrote me privately, and I think what he wants (he's checking out a file) is to enter a start time, an end time and a staff persons name, and then have the computer tell him if there is a conflict in scheduling the appointment being scheduled. Lee
Chuck Posted March 16, 2003 Posted March 16, 2003 Lee, I understood that. Creating a self-join relationship between a field that combines the user name, start and end times is one way to accomplish this. The ranges technique could be used, and if the relationship between the current record and the rest of the database is valid, then there's a conflict and the appointment wouldn't be allowed. I'm sure that your technique will cover his needs as well, but the link I provided is another possible option. Chuck
balooka Posted March 16, 2003 Author Posted March 16, 2003 thank you both alot The SmartRanges setup should indeed be the right thing for me. I yet have to figure out how to combine the hours and minutes in that example. That should be something I can work out myself (I hope )... Thanks Alot! JP
Chuck Posted March 16, 2003 Posted March 16, 2003 Actually, you don't have to figure it out how to separate hours and seconds. Times are simply numbers to FileMaker (seconds since midnight). Just use the start time and end time as the range for the smart ranges technique and it should work. Chuck
Recommended Posts
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