Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Results - Division

Status
Not open for further replies.

math20

MIS
Jul 7, 2005
71
CA
Hi,

I have a query that performs division based on two field values. My problem is the result it shows is huge and shows something like this: 8.00681431005111E-02

What I would like the filed to show is 0.08. I have tried to format the text box that holds this value on the report. I tried to format the filed in the query in design view but nothing seems to work. I would really appreciate if anyone can help me with this.

Thank you.
 
You may play with the Round function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Use formating to show it correctly
sample below
[tt]
Me.Text0 = Format(8.00681431005111E-02, "##,##0.##")[/tt]


________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Round function did not work.

When I use the code it can not recognize my filed name.

What I discovered is that the Division was an expression where I had the iif condition to catch any values being divided by zero, once I removed that if condition the value changed to 0.08681431005111. I guess I have to do without the iif condition.

Thanks for your advise. I also wanted to know for the round function I was using it in the query itself in the design view using the build property and selecting it, what it did was put that condition in the criteria filed. Was I doing it right?

Also for the code why did it not recognize the field name?
 
In a query it can be used like below
Code:
Expr1: Format([FieldName1]/[FieldName2],"#,##0.##")

or if you are using on a form then controlsource of a text box will be like
Code:
=Format([TextBox1]/[TextBox2],"#,##0.##")

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
I supposed to give Round Function example earlier..
Code:
Expr1: Round([TextBox1]/[TextBox2],2)

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top