Query Lookup

S

Secret Squirrel

I have a query that shows the number of years of service by employee. I want
to be able to look up based on the years of service and have it also show the
vacation accrual amount that is in my tblAccruals. Here is my current query:

SELECT tblEmployees.ID, qryVacationUsed.HoursCount AS VacationDaysUsed,
DateDiff("yyyy",[StartDate],Date()) AS YearsAccrued,
([YearsAccrued]-[VacationDaysUsed]) AS VacationAvailable
FROM tblEmployees LEFT JOIN qryVacationUsed ON tblEmployees.ID =
qryVacationUsed.EmpID;


My table accruals is as follows:

AccrualID
AccrualDays
AccrualYearsStart
AccrualYearsEnd

What I want it to do is see if the years of service is between the
AccrualYearsStart and AccrualYearsEnd and then have it show the AccrualDays
for that employee.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

dlookup in Query 10
Query Question 1
Append Query 11
Report Group Footer DLookUp 0
Update Query w/ Join 2
Query Date Problem 8
Update Query Question 3
Calculate Years of Service 11

Top