John said:
I'm sorry, Jay, but we're talking past one another. You're normalizing
THE WRONG TABLE. I'm guessing your School table was perfectly fine;
what needed changing was the wide-flat SchoolDatesTable (or, more
properly, SchoolDatesSpreadsheet). I'm now concluding that your
SchoolDatesTable *SHOULD NOT EXIST* - see below.
That is good news. I liked the School Table with its basic information of
each customer. It is simple and works very good.
How I am using the SchoolDatesTable is in a switchboard form where I can
see the Days from D1 to D31. I Then can enter the "."s, "X"s, "+", "-", and
I forgot to put these two in..... "A"s and no counting of Saturday and
Sunday and Holidays. No school on those days.
This is just a field in the SchoolNameTable.
This is just a field in the SchoolNameTable.
These are almost surely also just fields in the SchoolNameTable.
We have to count the Absent days too. The A days are not many. That is no
problem. We can just enter those. The Xs and . are many.
Now the reason for the ShoolDatesTable.
We have a complicated form that I had scanned, placed into a word document
and lined up a table on top of the image of the document. I merged the
SchoolDatesQuery made from the SchoolDatesTable to the Word Document. It
prints all information the X,A,.,+,-, and all totals. I have to do it this
way for my Boss who looks at these characters and verifies all totals. The
form must be done by hand or by computer.
This is just a field in the SchoolNameTable.
This is just a field in the SchoolNameTable.
These are almost surely also just fields in the SchoolNameTable.
We have to count the Absent days too. The A days are not many. That is no
problem. We can just enter those. The Xs and . are many.
Now the reason for the ShoolDatesTable.
We have a complicated form that I had scanned, placed into a word document
and lined up a table on top of the image of the document. I merged the
SchoolDatesQuery made from the SchoolDatesTable to the Word Document. It
prints all information the X,A,.,+,-, and all totals. I have to do it this
way for my Boss who looks at these characters and verifies all totals. The
form must be done by hand or by computer.
Don't use the reserved word Name as a fieldname; call it SchoolName
perhaps (though I'm not sure in this context what this is the name
OF).
Ok I will take note of that.
This contains the information in your EntryExit table, just recast,
correct? Do you empty the table and regenerate it every month? How do
you know whether Id 3, D4 is present on the 4th of April or the 4th of
March?
Yes. I will Append all records with exitdates to a drop table for storage.
Then run an update on the Tables and remove all dropped customers with exit
dates. The Tables grow large then reduced considerably at the end of the
month. Works smoothly.
up to as many records as are needed to record which ID's are present
on which Date.
No. All records stay and have A's in place of the X's for being not
in attendance on those days.
This appears to be a *REPORT*, a tool for *displsying* data. If you
are assuming that you must have a Table set up in the exact format of
your desired report, I see why we're miscommunicating! A Table *is for
data storage*, not for reporting. You will instead want to create a
Crosstab query based on your EntryExitTable, and base a Report (or
Form) ON THAT QUERY.
Yes. I am just using a query with two tables in it. SchoolMainTable with
all of the basic info and the ExitDatesTable with it's fields.
Everything works smoothly.
Next when an Exit Date is entered a "-" is placed in that Day and
all of the Days after it have "." inserted.
So it would look like this:
D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14
. . + X X X X X X X - . . .
I have all my calculation working. I calculate the total adds "+",
total drops "-" and Total "X"s.
This is a COMPLETELY SEPARATE ISSUE from the table with X'x, periods
and hyphens. You're counting *DAYS* - not X's - or at least you should
be. For example, a query:
SELECT ID, Position,
Sum(DateDiff("d", [Entry Date], [Exit Date])) AS DaysPresent,
Count([Entry Date]) AS TotalAdds,
Count([Exit Date]) AS TotalDrops
FROM SchoolEntryExitTable
GROUP BY ID, Position
WHERE <criteria to select the date range>
will give the number of days present, count of adds, and count of
drops for each ID.
I have the totals already.
I will book mark this and study it.
It's doable - but I really think you're *on the wrong track* trying to
do it in a wide-flat table like this. Doing so will make your job
*HARDER*, not simpler.
John W. Vinson[MVP]
Yes. I will Append all records with exitdates to a drop table for storage.
Then run an update on the Tables and remove all dropped customers with exit
dates. The Tables grow large then reduced considerably at the end of the
month. Works smoothly.
This appears to be a *REPORT*, a tool for *displsying* data. If you
are assuming that you must have a Table set up in the exact format of
your desired report, I see why we're miscommunicating! A Table *is for
data storage*, not for reporting. You will instead want to create a
Crosstab query based on your EntryExitTable, and base a Report (or
Form) ON THAT QUERY.
Yes. I am just using a query with two tables in it. SchoolMainTable with
all of the basic info and the ExitDatesTable with it's fields.
Everything works smoothly.
If we focus on 31 fields in the SchoolDatesTable with 2 other fields
EntryDate and ExitDate in the same table, and only 1 record, it may
just be easy to see.
A code is needed. Maybe an If Else statement.
If the EntryExit field has a date, then take the day in the middle of the
date like 04/25/05 and insert a plus to the left of D25 which is D24 and
followed by the "."s down to the last day "D1.
If the EntryDate Field does not have a date that is within the Current Month
then exit.
If the EntryDate Field is Null or empty then insert "." from Q1-D31
Then if the ExitDate Field has a date then take the middle two numbers which
is the day and insert a "-" in that D field followed by the "." up to the
last day which is "D31".
That would be cool. It would make this whole process automatic. No human
errors. Perfect. Not just mine but everyone. All 35 teachers.
One more point. The month has Sunday, Saturday and Holidays. There are no
X's in those days just insert the ".".
Months have 19 or 21 present days.