Skip 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.

Compare Dates&Times for Overlap

Featured Replies

  • Newbies

I have been using FMP for awhile and recently took on the task of creating a simple reservation/checkout database for AV equipment. I need to page through the current reservations and checkouts and see if the proposed checkout/reservation conflicts with any of the current checkouts & reservations. I am having trouble getting the script to work for both multiple day checkouts and hourly checkouts. Has anyone else done this? Examples? Help?

Thanks,

Cian

Can you describe the script you've tried and where it doesn't seem to be working?

For these situations it's always easiest to convert date and time into a single number to keep calculations simple. To do this, multiply the date by 86400 (number of seconds in a day) and add it to the time. You can do this arithmetic because Filemaker stores date and time values internally as days and seconds (past midnight) respectively. Suppose you have these fields for your existing reservations records:

ResOutDate, Date

ResInDate, Date

ResOutTime, Time

ResInTime, Time

you can convert these to:

ResOut = ResOutDate * 86400 + ResOutDate

ResIn = ResInDate *86400 + ResInTime

Then if you want to check for conflicts with a proposed reservation, calculate the proposed rental date/time fields in a similar way:

ProposedOut = ProposedOutDate * 86400 + ProposedOutTime

ProposedIn = ProposedInDate * 86400 + ProposedInTime

Now you can go through each record and use the following to test for conflicts:

Status = Case(ResIn<ProposedOut,"OK",

ResOut>ProposedIn,"OK"

"Conflict")

If any test returns "conflict" you know you have a problem.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.