Limit Decimal Places in Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that shows (in part) the average length of time it took
participants to graduate from a program in both days and months. In the
query I have set both of the Average fields (days and months) to "Format:
Fixed" and "Decimal Places: 1". The problem is, however, that when I
generate the report, I have the months text box Control Source set to:

=[AvgOfMonths] & " Months"

[AvgOfMonths] is obviously the number, and then " Months" is the text I
want to appear afterwards. The problem is, I can't get the numerical part to
limit itself to one decimal place. I've set the months text box in the
Report to "Format: Fixed" and "Decimal Places: 1" as well, but that doesn't
seem to work (I assume due to the text that follows it in the control source.
Any ideas on how to limit the number of decimal places??
 
That worked great, thanks Steve!

Tminn

Steve Schapel said:
Tminn,

Try it like this...
=Format([AvgOfMonths],"#.0") & " Months"

--
Steve Schapel, Microsoft Access MVP
I have a report that shows (in part) the average length of time it took
participants to graduate from a program in both days and months. In the
query I have set both of the Average fields (days and months) to "Format:
Fixed" and "Decimal Places: 1". The problem is, however, that when I
generate the report, I have the months text box Control Source set to:

=[AvgOfMonths] & " Months"

[AvgOfMonths] is obviously the number, and then " Months" is the text I
want to appear afterwards. The problem is, I can't get the numerical part to
limit itself to one decimal place. I've set the months text box in the
Report to "Format: Fixed" and "Decimal Places: 1" as well, but that doesn't
seem to work (I assume due to the text that follows it in the control source.
Any ideas on how to limit the number of decimal places??
 
Back
Top