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!

Passing Percents as Point Values

Status
Not open for further replies.

Cleis

Technical User
Jun 4, 2000
197
US
This one really has me stumped! Here is some of the relevant background:

My Query:

PY DM%: ([PYSales]-[PYCost])/[PYSales]
Running DM%: ([RunningSales]-[RunningCost])/[RunningSales]
DMPerIncrease: [PYDM%]-[RunningDM%]

I then want to pass DMPerIncrease via code to this Module:

Function CalcPayout(SalesIncrease As Double, IncrementalGP as Double, DMPerIncrease as Double) as Double

Dim Bonus as Double
Bonus = 0

If SalesIncrease >=0.1 and SalesIncrease <=.3 And DMPerIncrease >=0 then

. . . .ect

The problem is that it doesn't work all of the time. For what ever reason, I'm passing scientific numbers. I've tried CInt,CSng, on the DM% calcs to no avail. I've tried Format$ but I don't want a String Variable.

What I want is to calc the DM% Var and have an end result as a general number with two decimal points!

I hope I explained this clearly enough? Any help would be appreciated
!




Rich
 
Could you provide some specific numbers to your equations. It sounds like the calculations are working correctly but the value of the DMPerIncrease is so small that ACCESS has to display it in scientific representation. (i.e. 3.456E-55) If this is what is happening we should be looking at the calculations of the actual data to see how it is handling them.

Bob Scriver

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top