![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have 4 Access production tables each with two production indicators and each with an employeeID and a WeekOfYear (eg 2008-09) field. *I want to join them in *a query such that I get one line for each employeeID - WeekOfYear combination and have the 8 production indicators all in the same record. *The problem is that each employee does not work in each production area every week and so some employeeID - WeekOfYear combinations exist in some tables and not in others. *The typical joins then always seem to leave some data behind. I want to end up with something like: EmployeeID * * * *WeekOfYear * * * PI1 * * *PP2 * PI3 * * PI4 a432 * * * * * * * * * * 2008-11 * * * * * * * 17 21 * * * * * * * * 87 The blank is ok. Any ideas on getting them all to come into the query. Thanks Kevin |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
On Jan 29, 8:44*am, KC-Mass <connear... (AT) comcast (DOT) net> wrote: I have 4 Access production tables each with two production indicators and each with an employeeID and a WeekOfYear (eg 2008-09) field. *I want to join them in *a query such that I get one line for each employeeID - WeekOfYear combination and have the 8 production indicators all in the same record. *The problem is that each employee does not work in each production area every week and so some employeeID - WeekOfYear combinations exist in some tables and not in others. *The typical joins then always seem to leave some data behind.. I want to end up with something like: EmployeeID * * * *WeekOfYear * * * PI1 * * *PP2 *PI3 * * PI4 a432 * * * * * * * * * * 2008-11 * * * * * * * 17 21 * * * * * * * * 87 The blank is ok. Any ideas on getting them all to come into the query. Thanks Kevin If you have a weekOfYear table, you can build a cross-product query * select employeeId, weekOfYear from tblEmployee,tblWeekOfYear to give you all combinations that you can use with other queries |
#5
| |||
| |||
|
|
Greetings, If you could show some samples of your source data - the data the works as you desire and some samples of the data which doesn't work as desired (at least a few records - a few fields) -- then show a sample of what you want the result set to look like to include the data which works and the data which does not work (right now) (show at least a few records) - it would be easier to provide some suggestions what you could do to make it happen like that. Rich *** Sent via Developersdexhttp://www.developersdex.com*** |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |