C
Carlee
Hi there, I am hoping someone can help with my calculation error: I am
trying to convert a formula into a workable solution in Access but am not
getting the right results.
the function is: Min(TV *.1*.08, max(PrintCount-1.2(tv))*.08)
in my query i have this: min_max_result:min_max([tv],[printcount])
in a module I have this:
function min_max(tv,printcount)
dim result_tv as double
dim result_print_count as double
dim temp_result as double
result_tv = TV*(.1)*(.08)
result_printcount=PrintCount]-(1.2)*(TV)) * (.08)
if result_tv < result_printcount then
temp_result =result_tv
else
temp_result =result_printcount
end if
min_max=temp_result
end function
In the original function I should get a result of $44.80, but when I
implement this code, i get 0. Can anyone see why?
Thanks in advance
Carlee
trying to convert a formula into a workable solution in Access but am not
getting the right results.
the function is: Min(TV *.1*.08, max(PrintCount-1.2(tv))*.08)
in my query i have this: min_max_result:min_max([tv],[printcount])
in a module I have this:
function min_max(tv,printcount)
dim result_tv as double
dim result_print_count as double
dim temp_result as double
result_tv = TV*(.1)*(.08)
result_printcount=PrintCount]-(1.2)*(TV)) * (.08)
if result_tv < result_printcount then
temp_result =result_tv
else
temp_result =result_printcount
end if
min_max=temp_result
end function
In the original function I should get a result of $44.80, but when I
implement this code, i get 0. Can anyone see why?
Thanks in advance
Carlee