Schedule for a school

Hi

I have an app of for a foreign language school and I want to create a schedule for their lessons

The students give the day and the hours they have obligations and they couldn’t be in their lesson of the school
I have a table OBLIGATIONS with
NAME,
DAY,
START HOUR,
END HOUR
for their obligations outside of the school.
They can’t attend their classes between START HOUR and END HOUR for the specific day

I have created a form with three free fields
DAY,
A HOUR,
B HOUR

I want for a specific day of a week and for a range between A HOUR and B HOUR, to select all the students they don’t have obligations.
I want to be sure that between A HOUR and B HOUR for a DAY they don’t have obligations from the table OBLIGATIONS (for this DAY and the range between, START HOUR and END HOUR)

I would appreciate your help

Sakis

Hi. One way to do this is to leverage the natural parent child relationship between a class/lesson and the obligations/students. In your case, for a “lesson” you want the list of students with no conflicting obligations. That’s a select statement. Here’s a simple app that shows this: https://www.appsheet.com/samples/Sample-App?appGuidString=6844ca1c-32ff-4b0a-a106-1e45aa5b9bde

The select in this app is built from the point of view of a lesson/class, and looks like this:
select(obligations[NAME],
and(
[ObligationStart] <> [ClassStart],
[ObligationEnd] <> [ClassEnd]
)
)

Here it is in the virtual column definition:

Hope this helps.

Thank you TyAlevizos (are you Greek?)

If ObligationStart=14:15 and ObligationEnd=16:15
and ClassStart=14:00, ClassEnd=16:00

then this formula has a problem
It shows that the student could attend the class but he isn’t available because in this time he has another obligation

I want to search between two times and not a particular hour

Ah, that’s a bit more complicated. I have updated the app, the new calc is:

select(obligations[NAME],
or(
and([ObligationStart] <= [ClassStart],
[ObligationEnd] >= [ClassStart]),

and([ObligationStart] >= [ClassStart],
[ObligationEnd] <= [ClassEnd]),

and([ObligationStart] <= [ClassEnd],
[ObligationStart] >= [ClassStart])

)
)

You should probably check my calculation and make sure I have all possible time patterns covered, but this appears to work. (yes, greek american 3rd gen)

This expression is for a list of the students who HAVE obligations in these time periods.

But it is very useful!
It helps me to find the students who aren’t in this list and they are free and available to attend the classes

Efxaristo para poly TyAlevizos :-))