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