I am some difficulty writing a query in Access, and was wondering if I can get some advice. Here is the basic structure:
The tblBillingPeriods table will just contain start/end dates, which for now is:
The tblBillingRates table contains the various employee's rates for the given billing periods:
The tblTimeRecords table is the main data table, and contains records of work items done by an employee, the date performed, task performed, customer, hours spent, description, etc.
When I query the tblTimeRecords table, I would like to include the correct rate based on where the timrecDate falls into the date range in tlbBillingPeriods. for example:
I can't put my finger on how to set up the join to allow this easily, does anyone have any advice on how this could be set up? Or should I be setting these tables up differently? Thanks!
The tblBillingPeriods table will just contain start/end dates, which for now is:
Code:
id StartDate EndDate
1 01/01/2005 12/31/2005
2 01/01/2006 12/31/2006
Code:
id billingperiodID empID rateamount
1 1 1 $50.00
2 2 1 $75.00
3 1 2 $100.00
4 2 2 $125.00
Code:
id timrecEmpID timrecDate hrs, cust, task, desc, etc
1 1 06/10/2005
2 2 06/10/2006
Code:
id timrecEmpID timrecDate rateamount
1 1 06/10/2005 $50.00
2 2 06/10/2006 $125.00