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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Math Formula problem

Status
Not open for further replies.

ropewrench

Programmer
Joined
Feb 20, 2005
Messages
10
Location
US
Having problems with a seemingly simple formula in Crystal 8.5 (also tried on demo version of Crystal 11)
Using Basic Syntax:
dim qtya as number
dim qtyb as number

qtya = (176/91)
qtyb = 176
Formula = qtyb/(qtya)

Results on Report:
91.00
Should get 91.003 (field is formated to 4 decimal places)

On the actual report qtyb is a sum field on the report and qtya is another sum field on the report that is always divided by 91. No matter what value qtyb is, the result on the report always equals 91.

respectfully,
ropewrench
 
If you don't do any rounding, the answer IS 91, i.e.,

176/91 = 1.93406593

176/1.93406593 = 91.00000019

So it looks like you are rounding the qtya to 3 decimals 1.934 in order to 91.003. If this is what you want, then change your formula to:

round(qtyb/round(qtya,3),3)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top