oxicottin
Learning by pecking away....
- Local time
- Today, 08:39
- Joined
- Jun 26, 2007
- Messages
- 856
Hello, I need to create an query expression from my table that checks if there is a year [boughtYear] and if so is the yes/no field [boughtvac] true or false using a criteria and if there is a year then under my expression give a number 40 and if there is no such year then give a 0 for each employee [EmployeeID]
I tried....
test: IIf([BoughtVac]=True,40,0)
But for the employees that don't have a year entry [boughtYear] OR [boughtvac] they don't show up in my results and I need them in there.
I tried....
test: IIf([BoughtVac]=True,40,0)
But for the employees that don't have a year entry [boughtYear] OR [boughtvac] they don't show up in my results and I need them in there.
SQL:
SELECT tbluEmployees.EmployeeID, tbluBoughtVacation.BoughtVac, IIf([BoughtVac]=True,40,0) AS test, tbluBoughtVacation.BoughtYear
FROM tbluEmployees INNER JOIN tbluBoughtVacation ON tbluEmployees.EmployeeID = tbluBoughtVacation.EmployeeID
GROUP BY tbluEmployees.EmployeeID, tbluBoughtVacation.BoughtVac, tbluBoughtVacation.BoughtYear
HAVING (((tbluBoughtVacation.BoughtYear)=([Forms]![frm_Switchboard]![cboYear])));