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

0 4 357
4 REPLIES 4

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

Top Labels in this Space