Format Numbers in Query Text Field?

Debased

Registered User.
Local time
Today, 13:12
Joined
Mar 11, 2004
Messages
112
I have a field in a query that contains numbers and text (text field). The numbers displayed come from a percent calculation and display with many decimals ie, .99898745987245. Is there a way to eliminate the decimals with code in the query field? For example .99898745987245 to equal 99%? I can’t format the field as a number or percent because it has both text and numbers. HELP!!
Thanks
 
I'm not aware of any way you could do this except by changing the field to numeric (someone else may know a way).
Can you split what you have into 2 fields, one for the necessary text and one for numbers?
Generally you would format the numeric field to limit the number of decimal places by right clicking, select properties and in the format field selecting the number of whole numbers and decimal places.
Example: 0.00 in the format field will give you all of the whole numbers and 2 decimal places.
 
force the number to text when you do the calulation to get the percent figure in the first place.

Format([first Field]/ [second field] / 100, "#0.00") & "%"

Should do it.

HTh

Peter
 
BATman that worked thanks so much! Here is the code I used in case anyone is interested:

Format([TotalScore]/(150-[TotalNAScore])*(100),"0") & "%"
 

Users who are viewing this thread

Back
Top Bottom