Related to a recent post, I'm investigating the "billability" of my employees. I have five different folks that turn in timesheets with a few categories on them where they allocate their time. I have a query that works just fine that calculates, on a weekly basis, what their billability is. The query is:
[tt]SELECT tblPeople.FirstName, IIf(Billable=0,Format(0,"Percent"),Format([Billable]/([Billable]+[Overhead]),"Percent")) AS BillRate
FROM tblPeople INNER JOIN tblHours ON tblPeople.ID = tblHours.PersonID
ORDER BY tblPeople.FirstName;
[/tt]
The IIF statement is there in case they were on vacation the whole week to return a zero, otherwise I get a #Num! and I can't perform any additional calculations. Or at least, that's what I think.
What I want to do is average the billability for each person. I keep trying to figure out a way to get Access 2010 to average the percentages but Access throws up the error "data type mismatch". Not sure what to do.
Thanks!!
Matt
[tt]SELECT tblPeople.FirstName, IIf(Billable=0,Format(0,"Percent"),Format([Billable]/([Billable]+[Overhead]),"Percent")) AS BillRate
FROM tblPeople INNER JOIN tblHours ON tblPeople.ID = tblHours.PersonID
ORDER BY tblPeople.FirstName;
[/tt]
The IIF statement is there in case they were on vacation the whole week to return a zero, otherwise I get a #Num! and I can't perform any additional calculations. Or at least, that's what I think.
What I want to do is average the billability for each person. I keep trying to figure out a way to get Access 2010 to average the percentages but Access throws up the error "data type mismatch". Not sure what to do.
Thanks!!
Matt