I have a points based attendance database that I am trying to enhance with different rules based on if the employee is part time or full time, for instance I am trying to Dsum their points from all occurrences within the last 365 days but if now I am trying to create some sort of IF the "employeestatus" = PT then only dsum from after Jan 1, 2012 since part time employees had a policy change and I don't want to tally points before the 1st of this year. Can anyone help me understand how to change this expression or allow me to convert it to an IF THEN ELSE statement where I can run different queries based on the value of the "employeestatus" field?
This is what I have in the control source for the text box on a form that totals the employees current points.
Code:
=DSum("Points","qryTardy","EmployeeID = " & [txtEmployeeID])
qryTardy is the query that filters all occurrences in the last 365 days
I want the ability to run qryTardyPT if the "employeestatus" field = PT
qryTardy:
Code:
SELECT tblEmployeeTardy.EmployeeTardyID, tblEmployeeTardy.Date, tblEmployeeTardy.EmployeeID, tblEmployeeTardy.Hours, tblEmployeeTardy.Minutes, tblEmployeeTardy.Comments, tblEmployeeTardy.Points, tblEmployeeTardy.TardyID
FROM tblEmployeeTardy
WHERE (((tblEmployeeTardy.Date)>=Date()-365));
Sorry if this sounds convoluted, I have a hard enough time wrapping my brain around it asa semi beginner to Access