It sounds it can be done in one step, indeed, but then, at least from what I
understand, you may consider using a Cartesian join rather than an inner
join. A Cartesian join is what you get when you bring two tables WITHOUT any
constraint. As example, just for illustration purpose, if you have a table
Days, with one field, theDay, with values from 1 to 31 and, also, have
another table, Hours, one field, theHour, with values from 0 to 23, then, to
get all possible mix, from {theDay=0, theHour=0} to {theDay=31,
theHour=23}, someone can use a Cartesian join:
SELECT theDay, theHour
FROM Days, Hours
You can then append that data to a third table, Schedules, three fields:
theDay, theHour, theComment, with something like:
INSERT INTO Schedules(theDay, theHour)
SELECT theDay, theHour
FROM Days, Hours
That would add 31 * 24 new rows to Schedules, with the default value in the
field theComment. The default value can be specified at the design table for
table Schedules, or, the value NULL would be use, if no default value has
been specified at the table design.
Once these new rows are appended, the table Schedules can be open, and the
field theComment can be changed, as usual.
And at the end of the month, if you want, you can remove the rows which have
nothing in the field theComment, still as example.
Does that help you a little?
Vanderghast, Access MVP
Using an inner join on a table with no record, indeed, produces something
with no record. You use:
... FROM ... Employees INNER JOIN EmployeeProduction ...
and since if EmployeeProduction is empty, there will be no possible match.
The FROM clause then 'returns' an empty set of records. You can, better
than
me, say why you need that inner join with something that can be empty.
Hi Michael,
I am pretty new to Access and am probably trying to do something that
I have not designed my tables to do I think.
The Employees and Shift tables contain all static data re: Employees
(i.e., name, shift, dept, job function, etc.) and Shift includes the
Shift number and the length in hours of each shift (ShiftHours).
EmployeeProduction is junction table that needs to hold each employees
Name via EmployeeID and the ACTUAL number of hours they worked in
which of two job functions during that shift. It is only populated by
each shift/dept supervisors input.
I am trying to setup a form that allows a supervisor to input all of
the default data for each employee by Shift, Dept, and JobFunctionID
so the supervisor, at the end of the shift, can change the hours
worked by each employee given whether they worked more or less hours
during that shift and in which job function.
The whole purpose is to enter all of the default data i one fell swoop
to midify it later.
Am I going about this wrong from a design perspective?
Thanks,
Tim