John…
I will have to recreate this thread from memory since I spent a lot of time
composing it and lost it when I tried to send it…I had many interruptions
(you’d think I’d learn to type it and copy it to the NG-since this isn’t the
first time this has happened to me) :-(
Here is what (I hope) I wrote:
Although this point is probably mute, since I think I found the solution. I
say “think†because it was too simple (red face). Here is the simple
solution that I came up with.
Valid Btl Price: =IIf([Bottle Price]*1000=Int([Bottle Price]*100)*10,1,0)
***your calc
Bottle Price: =Case Price/Units per case
Rnd Price: =Round([Bottle Price],3)
New Case Price: = IIf([Valid Btl Price]=0,[Rnd Price]*[Units per case])
***This calculation gives me inconsistent results. Examples:
Case price = 55.2
Units = 12
Bottle price (in Access) = 4.60000006357829
Bottle price on calculator = 4.6
Case price =116.4
Units = 12
Bottle price (in Access) =9.70000012715658
Bottle price on calculator = 9.7
Both of the bottle prices have a zero as the third position of the decimal
(which is what I thought I was checking for), so why does Access respond with
a zero (meaning that the bottle price is not acceptable) in the calculation?
This doesn’t seem to be a problem, since I still get the correct case price
when multiplied times the units. It just performs this calculation when it
is not necessary.
A little background, this company uses beverage industry software that was
designed to use bottle price (as opposed to case price). The pricing program
gives the case price and calculates the bottle price. The beverage software
will not allow the third digit of the decimal place to be anything other than
a zero. Thus, the question.
What is stored as the bottle price? Will this come back and bite me later?
Regarding your last thread, I don’t see any difference between the two
calculations that you gave first, am I missing something?...or did you just
copy and paste and forget to change the second calc?
I didn’t try the last calc, since I don’t want to strip off the last digit –
as you said it would do.
I think I captured it all…whew!
Thanks,
Donna
PS...after I composed this again...our server went down...can you believe it?
John Spencer (MVP) said:
You could try another method. I'm not sure what you are doing, but perhaps the
following would work
IIF ([Case Price]*1000 MOD [Units] = 0, [Case Price]/[Units], [Case Price]*[Units])
Or perhaps you mean
IIF ([Case Price]*1000 MOD [Units] = 0, [Case Price]/[Units], [Case Price]*[Units])
If what you want is to strip off the last digit, then you could use
Int(CCur([Case Price])*100/[Units])/100