J
Julia Boswell
Hi folks,
I'm having a real problem getting a query (or set of queries to work) and no
matter what I try I fail :-( I wonder if someone could help me with the
approach?
I need data from 4 tables and I'm aware I need to create a series of queries
to end up with the final one, but how?
The tables are:
Employees with employeeID (primary key), employeename, startdate being the
key fields
TrainingDue with recordno (primary key), employeeID, trainingcourseID
TrainingCompleted with recordno (primary key), employeeID, trainingcourseID,
completedate being the key fields.
TrainingCourses with trainingcourseID (primary key), training course,
frequency being the key fields (note frequency is a long numeric field
identifying number of months)
My query should show all training due sorted in training course order and
when it is due for each relevant employee. I therefore want my final query
to pick all employees in the TrainingDue table that have training identified
as due. The problem is the date fields.
I need a "last completed date" which picks a matching max date from the
trainingcompleted table or displays "never completed" if there is no
matching record in the training completed table. If I use a base query to
select maxoftrainingcomplete, the query tends to display the last completed
date for the course period, not the last completed date for the course for
each employee.
I also need a "next due date" which adds the number of months in the
frequency field onto either the startdate (if the course has not been
completed) or onto the last completed date. This fails as the last completed
date I can't get working.
Any ideas?
Thanks
Julia
I'm having a real problem getting a query (or set of queries to work) and no
matter what I try I fail :-( I wonder if someone could help me with the
approach?
I need data from 4 tables and I'm aware I need to create a series of queries
to end up with the final one, but how?
The tables are:
Employees with employeeID (primary key), employeename, startdate being the
key fields
TrainingDue with recordno (primary key), employeeID, trainingcourseID
TrainingCompleted with recordno (primary key), employeeID, trainingcourseID,
completedate being the key fields.
TrainingCourses with trainingcourseID (primary key), training course,
frequency being the key fields (note frequency is a long numeric field
identifying number of months)
My query should show all training due sorted in training course order and
when it is due for each relevant employee. I therefore want my final query
to pick all employees in the TrainingDue table that have training identified
as due. The problem is the date fields.
I need a "last completed date" which picks a matching max date from the
trainingcompleted table or displays "never completed" if there is no
matching record in the training completed table. If I use a base query to
select maxoftrainingcomplete, the query tends to display the last completed
date for the course period, not the last completed date for the course for
each employee.
I also need a "next due date" which adds the number of months in the
frequency field onto either the startdate (if the course has not been
completed) or onto the last completed date. This fails as the last completed
date I can't get working.
Any ideas?
Thanks
Julia