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

Prevent to events in one periode of time

Featured Replies

Dear FM talents,

I have a challenging problem. In a table with:

- students (indexed ID related to other table)

- dates (date)

- lesson start (time)

- lesson end (time)

I'd like to prevent making an new record with a lesson that starts or finishes while another lesson takes place. I've made a self-join and a calculated field (with patterncount(list(etc.);dates)) to identify the lessons that take place on the same day, but I don't know how to do it with the times. It only works when two lessons start or finish at exactly the same time, but I want to identify the lessons that have a time overlap.

Any ideas?

Thank you!!!!

EB

Your relationship needs to be something like:

Events::StudentID = Events 2::StudentID

AND

Events::Date = Events 2::Date

AND

Events::StartTime < Events 2::EndTime

AND

Events::EndTime > Events 2::StartTime

AND

Events::EventID ≠ Events 2::EventID

I am not sure what you're trying to do with "patterncount(list(etc.)". All that's required to count the related records is:

Count ( Events 2::EventID )

  • Author

Thank you! I was trying to do these relationships through calculations... quite impossible...

One more question though: these are AND relationships, can I make OR relationships as well?

For instance:

start time > 2::start time

AND start time < 2::end time

OR

end time > 2::start time

AND start time < 2::end time

What would be the purpose of that? All possible overlaps (and only overlaps) are already included in the relationship as stated:

...

Events::StartTime < Events 2::EndTime

AND

Events::EndTime > Events 2::StartTime

...

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.