I am challenged by knowing the best practices with respect to getting a result I need programmatically or via a query result. Any advice on the following scenario is most appreciated. I'm simplifying for demonstration purposes...
The user enters production data by date, shift and product. In the Production table, the ShiftID is the PK relates to the date, shift & product. FK's include ID's from all the different process tables where specific process data on the individual products is captured.
tblProduction
ShiftID (PK)
Date
Shift (A or B)
ProductID (FK to product details)
Process1ID (FK to process details)
Process2ID (FK to process details)
...etc
In order to report total production on a product over the course of a shift, I have to check if there is data on that product from the previous shift and if so, subtract EOS (end of shift) plant inventory reported on the current shift from total production.
Total production by shift, date and product is a series of major calculations in and of itself and I've managed to sort that out in a calculated expressions in a query.
Does anyone have any suggestions on how I can check for data entry in the previous shift for a product? I only need to check the data in one process table but link to the calculation query for the total production result.
I hope this makes sense. If not, I will try to elaborate by mocking up a simple example of my overly complex db.
TIA!
ML
The user enters production data by date, shift and product. In the Production table, the ShiftID is the PK relates to the date, shift & product. FK's include ID's from all the different process tables where specific process data on the individual products is captured.
tblProduction
ShiftID (PK)
Date
Shift (A or B)
ProductID (FK to product details)
Process1ID (FK to process details)
Process2ID (FK to process details)
...etc
In order to report total production on a product over the course of a shift, I have to check if there is data on that product from the previous shift and if so, subtract EOS (end of shift) plant inventory reported on the current shift from total production.
Total production by shift, date and product is a series of major calculations in and of itself and I've managed to sort that out in a calculated expressions in a query.
Does anyone have any suggestions on how I can check for data entry in the previous shift for a product? I only need to check the data in one process table but link to the calculation query for the total production result.
I hope this makes sense. If not, I will try to elaborate by mocking up a simple example of my overly complex db.
TIA!
ML