Limit Decimal Places in Function

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??
 
G

Guest

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??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top