Dear Net:
You seem to have fallen off the edge of the earth in the middle of posting.
The structure of the data as imported is faulty for the purpose of creating
a database. You should transform it into something more usable.
Please consider having something built like this:
Employee (Table)
ClockNo
EName
Job (Table)
JobName
EmployeeJob (junction table)
ClockNo
Sequence
JobName
For your fragmentary information given, you would have this in the tables:
Employee
ClockNo EName
xxxxx John DOe
Job
JobName
Job1
job3
EmployeeJob
ClockNo Sequence JobName
xxxxx 1 Job1
xxxxx 2 job3
You can produce this from the table you have with queries:
SELECT DISTINCT [Clock #], [Name] FROM Primary
SELECT DISTINCT JobName FROM (
SELECT JobName1 FROM Primary WHERE JobName1 IS NOT NULL
UNION ALL
SELECT JobName2 FROM Primary WHERE JobName2 IS NOT NULL
UNION ALL
SELECT JobName3 FROM Primary WHERE JobName3 IS NOT NULL) X
SELECT [Clock #], 1 AS Sequence, JobName1
FROM Primary
WHERE JobName1 IS NOT NULL
UNION ALL
SELECT [Clock #], 2 AS Sequence, JobName2
FROM Primary
WHERE JobName2 IS NOT NULL
UNION ALL
SELECT [Clock #], 3 AS Sequence, JobName3
FROM Primary
WHERE JobName3 IS NOT NULL
After testing, you can convert these 3 queries into append queries into the
3 respective tables.
The above will work only once, when the tables are empty. Afterward, the
first two queries would need to eliminate any rows already recorded and
append only what is left. The third one would take some study to be able to
determine what is best.
Tom Ellison
netadmin said:
I have some imported information on Eployee Jobs. The Primary table has
imported information in this format;
Clock # Name JobName1 JobName2 JobName3
xxxxx John Doe Job1 job3
I created some queries from the Primary table to define a list of who is
qualified for certain jobs.
There are 32 jobs