Jump to content

Filtering a Schedule List by Period Number


This topic is 3251 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello, I have a database with that has a student schedule. The schedule consists of 8 different records related to the student ID. So there are 8 periods per student. Currently, I have the list that shows the student schedule from Period 1 to 8 and consists of The Period Number and Room Number. However, I only want the List to show Period number 7 so I can sort the records by the room number and not have to manually sort it myself when I print it out.

I have it done by using a portal and filtering it by period = 7 but when I go to sort it does not sort out by room number. 

Link to comment
Share on other sites

I think I know what you mean but what I am trying to do is send a letter to every student in the school. So what I have is a letter layout and then the portal of the students let say 8th period in the bottom right corner of the letter. I want to sort the letters by room number this way I get the room stack go to the room and pass them out. When i go to sort by room number nothing happens, I'm assuming it's because it's through the portal.

Link to comment
Share on other sites

Filtering and portal sorting is not going to help you when you sort the parent records. One alternative might be to find and print your letters from the Period table context. Another way might be to create a calculated field to derive the Period you want, or just a static text or number field that you set manually or via script.

Link to comment
Share on other sites

Yes, you are right, filtering and sorting a portal is not helping me. I uploaded a screenshot of part of the letter so others can understand better. I am not trying to filter or sort the portal, I have already done that.

This is where I am lost Fitch. I am not sure how the calculation would look like so that I ONLY get the room number of their seventh period or 8th period. Whichever I chose so after I do I can sort the records, not portal, by room number and simply print them ready to pass out.

Sorry if I may have worded my previous posts poorly and didn't get my correct message across.

Screen Shot 2015-05-26 at 5.19.56 PM.png

Link to comment
Share on other sites

I think your form should be based on the Schedule table, where you can find exactly the record(s) you need, plus have access to all of the related Student data; like:

Enter Find Mode
Go to Layout [ Schedule_FormPrint (Schedule ) ]
Set Field [ Schedule::period ; 7 ]
Perform Find
# next step necessary?
Sort Records [ by Schedule::roomNumber ]
Print []

Edited by eos
Link to comment
Share on other sites

eos spelled out nicely my first suggestion. I agree this will probably be the easiest method to implement.

But if you prefer to stick with the Student layout, you could do the Find as eos described, and then while on the Schedule layout, set a (non-calculated) field in Student via a relationship, either with a looping script or using the Replace Field Contents command.

If you were to instead use a calculated solution, it would be a little complicated. You'd need an unstored calculated field using a function like this in the Schedule table. This would allow you to know the value number of Period 7 in your list of related records, i.e., where it falls in the list. And then you'd use GetNthRecord with that calculated result to get the room number.

Link to comment
Share on other sites

This topic is 3251 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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