Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TIME ranges || how to check new entries...

Featured Replies

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

  • Author

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 B) 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

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

blush.gif)

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

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

smile.gif

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

  • Author

thank you both alot smile.gif

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 smile.gif )...

Thanks Alot!

JP

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.