Problem with defining criteria in query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dario90@gmail.com

    Problem with defining criteria in query

    I have a query which takes data from 3 tables: Errors, Employees on
    work stations, Employees. In our company we have a production line and
    every employee has one-week assignment- e.g. on station AM, then
    another week on station AN etc. Query connects errors with employees
    and we have a briefly view on the situation. I used the function DMax
    to have less work with assignments- we want to do it every Monday for
    a whole week. But when i have different dates in fields 'Dates' from
    table 'Employees on ...' the query shows only errors with the last
    date, not the everyone. Do somebody know how can i define the criteria
    for every employee- so the function DMax will find the last date for
    every employee's ID not the last date in the whole table?
  • timmg

    #2
    Re: Problem with defining criteria in query

    Sounds like you may want to create a subquery on the Errors table that
    groups by Employee and selects the max date - either overall, or
    within a specific period (which is my hunch as the better choice).

    Use that query to join back to the other tables to show the required
    data.

    Best I can offer with the information given.

    Tim Mills-Groninger

    On May 12, 3:10 am, dari...@gmail.c om wrote:
    I have a query which takes data from 3 tables: Errors, Employees on
    work stations, Employees. In our company we have a production line and
    every employee has one-week assignment- e.g. on station AM, then
    another week on station AN etc. Query connects errors with employees
    and we have a briefly view on the situation. I used the function DMax
    to have less work with assignments- we want to do it every Monday for
    a whole week. But when i have different dates in fields 'Dates' from
    table 'Employees on ...' the query shows only errors with the last
    date, not the everyone. Do somebody know how can i define the criteria
    for every employee- so the function DMax will find the last date for
    every employee's ID not the last date in the whole table?

    Comment

    Working...