Using Microsoft Access 2010
I have a database built to total people's billable hours vs overhead hours but also keep track of vacation, which is not used in the calculation of "billability".
The calculation goes like this:
[tt]Billable
---------------
Billable + Overhead[/tt]
So if a person takes a week of vacation, I'm dividing by zero and I can't average the person's billability over time as Access can't use #Num! in a calculation.
How do I avoid this situation?
Here's the query:
[tt]SELECT tblPeople.FirstName, Format([Billable]/([Billable]+[Overhead]),"Percent") AS BillRate
FROM tblPeople INNER JOIN tblHours ON tblPeople.ID = tblHours.PersonID
ORDER BY tblPeople.FirstName;
[/tt]
Thanks!!
Matt
I have a database built to total people's billable hours vs overhead hours but also keep track of vacation, which is not used in the calculation of "billability".
The calculation goes like this:
[tt]Billable
---------------
Billable + Overhead[/tt]
So if a person takes a week of vacation, I'm dividing by zero and I can't average the person's billability over time as Access can't use #Num! in a calculation.
How do I avoid this situation?
Here's the query:
[tt]SELECT tblPeople.FirstName, Format([Billable]/([Billable]+[Overhead]),"Percent") AS BillRate
FROM tblPeople INNER JOIN tblHours ON tblPeople.ID = tblHours.PersonID
ORDER BY tblPeople.FirstName;
[/tt]
Thanks!!
Matt