Jump to content

Using various tables to create new records

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

Recommended Posts

Hope I can explain this one. In general I have students that eat lunch. There are 3 categories, A, B, and C. There are 30 classes. There are a number of dates per month per schoold year. I need to gather the number of students in each class, for each day of the month, for each category. For example, class 01 for 1/1/1011 had 10 A lunches, 20 B lunches and 30 C lunches.Then it's done again for the next school day in January. After all dates for class 01 are used, we go to class 02 for the same thing.

So I created a lunch database that has a table of classes - all are classes, like 01, 02, 11, etc. A table of all the days for each month that we have school. That table has the month number and the date as fields.I have the line item table that has class, month, date, category (A,B,or C) and number of lunches. Each of those line items can be created by creating a new record and putting the info in. I decided to try to set it up so the only entry would be the number of lunches.

I was trying a script that would loop through each day of January, then loop through each class within that date and create three records - one with the catergory A, one with B and one with C. Then the only entry is the number of lunches per line item.

I hope this was sonewhat clear. I'm not an FM ace and am having trouble setting this up. I tried to first go to layout of dates, pick january dates, sort them, then go to next loop of classes and for each of those classes for that date create my three records. Just not working right.

SOunds like a toughie but if anyone out there can help out it would be appreciated. Thanks. The input folks are on my head about this.


Link to comment
Share on other sites

I think all you need to do is find the records in the date range you want to report on, and sort them by class, date and category. Use a sub-summary part for each of these, so you will get something like:

Class O1


A 10

B 20

C 30


A 11

B 22

C 33


A table that contains nothing but dates of the calendar is redundant.

Link to comment
Share on other sites

This topic is 4387 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.