Greetings.
I'm embarrassed to put this out here, but the brain is fried and I'm obviously not seeing the obvious...
In a query, used as the basis for both other tables and for reports, I need to calculate percentages, like the percent complete (using two numeric fields, which could have decimal entries). I'm using the Design View for the query and creating my own field, as thus:
CalcPrctComplete: IIf([MainTable]![Estimated_Hours]>0 And [MainTable]![Actual_Hours]>0,iif( (round([MainTable]![Actual_Hours])/([MainTable]![Estimated_Hours])*100)>99,100,(round([MainTable]![Actual_Hours])/([MainTable]![Estimated_Hours])*100)),0)
My problem is I get results like 27.272727 or 83.33333 and all I want is the whole number (i.e. 27 or 83). Since some things will be zero and some things 100, I don't think I can use rTrim or Len type of functions. I can't find a "whole" or "percent" type of function on the built in list to specify no decimal places.
Any thoughts about being able to have the results be a whole (no decimal place) number?
Thanks!
LJ
I'm embarrassed to put this out here, but the brain is fried and I'm obviously not seeing the obvious...
In a query, used as the basis for both other tables and for reports, I need to calculate percentages, like the percent complete (using two numeric fields, which could have decimal entries). I'm using the Design View for the query and creating my own field, as thus:
CalcPrctComplete: IIf([MainTable]![Estimated_Hours]>0 And [MainTable]![Actual_Hours]>0,iif( (round([MainTable]![Actual_Hours])/([MainTable]![Estimated_Hours])*100)>99,100,(round([MainTable]![Actual_Hours])/([MainTable]![Estimated_Hours])*100)),0)
My problem is I get results like 27.272727 or 83.33333 and all I want is the whole number (i.e. 27 or 83). Since some things will be zero and some things 100, I don't think I can use rTrim or Len type of functions. I can't find a "whole" or "percent" type of function on the built in list to specify no decimal places.
Any thoughts about being able to have the results be a whole (no decimal place) number?
Thanks!
LJ