B
Beeker
I hope someone can help me! I'm frustrated!
I have a database that collects production data. Employees are rated by
performance and have standards to guide them. I need to create an
expression in a query to lookup the standard based on the area worked.
But the standard can change and should be pulled based on an effective
date.
My tables and fields are:
'tblStandards'
---------------
Type (Text)
Category (Text)
Standard (Number, Integer)
Effective Date (Date/Time)
'RawDataInput'
---------------
EmployeeID (AutoNumber)
Date (Date/Time)
Hours (Number)
Pieces (Number)
I created a query which totals all the Hours and Pieces. I need to make
calculated field that looks up the standard and compares the date for
each record and returns the associated standard.
If the Raw data is:
RecordID EmployeeID Date Category Hrs Pieces
-------- ---------- -------- -------- --- --------
3 56 6/5/2006 Consumer 4 695
4 99 6/6/2006 Consumer 2 280
5 56 6/6/2006 Consumer 4 587
And the Standards data is:
Type Category Standard EffectiveDate
------ -------- -------- -------------
Spares Consumer 90 6/1/2006
Spares Small 30 6/1/2006
Spares Consumer 80 6/6/2006
For record 3, the query should return a standard of 90 and record 5
should return 80.
How do I compare the dates in the Raw data to the Standards table to
find the correct Standard?
Any help will be greatly appreciated.
I have a database that collects production data. Employees are rated by
performance and have standards to guide them. I need to create an
expression in a query to lookup the standard based on the area worked.
But the standard can change and should be pulled based on an effective
date.
My tables and fields are:
'tblStandards'
---------------
Type (Text)
Category (Text)
Standard (Number, Integer)
Effective Date (Date/Time)
'RawDataInput'
---------------
EmployeeID (AutoNumber)
Date (Date/Time)
Hours (Number)
Pieces (Number)
I created a query which totals all the Hours and Pieces. I need to make
calculated field that looks up the standard and compares the date for
each record and returns the associated standard.
If the Raw data is:
RecordID EmployeeID Date Category Hrs Pieces
-------- ---------- -------- -------- --- --------
3 56 6/5/2006 Consumer 4 695
4 99 6/6/2006 Consumer 2 280
5 56 6/6/2006 Consumer 4 587
And the Standards data is:
Type Category Standard EffectiveDate
------ -------- -------- -------------
Spares Consumer 90 6/1/2006
Spares Small 30 6/1/2006
Spares Consumer 80 6/6/2006
For record 3, the query should return a standard of 90 and record 5
should return 80.
How do I compare the dates in the Raw data to the Standards table to
find the correct Standard?
Any help will be greatly appreciated.