What I have is this.
We have some prepack cards (medications) and this cards have diferent
amounts of pills in them... could be 30, 15 , 45 etc. that's my [c size]
The other field [first count] is the numbers of those cards we have in stock
at the time of the physical count.
[bottle size] is the manufacturer bottle quantity.
What I'm doing is taking the the count and * the card size... then dividing
by the bottle size to get the amount of bottles we have in those cards.
However we want to convert the results to a more accurate number.
So if the amount is less then 1 we want to convert to 0.5
If it's between an #(interger) and #.25 we want to convert it to #
If it's between an #.26 and #.75 we want to convert it to #.5
If it's between an #.76 and the next up # we want to convert it to the next
up #
This is what I had but this are separate columns but it does not work.
TOTAL COUNT1: IIf(([c size]*[first count]/[bottle size]-Int([c size]*[first
count]/[bottle size])) Between 0.75 And 0.999999,Int([c size]*[first
count]/[bottle size])+1,[c size]*[first count]/[bottle size])
TOTAL COUNT2: IIf(([c size]*[first count]/[bottle size]-Int([c size]*[first
count]/[bottle size])) Between 0.26 And 0.75,Int([c size]*[first
count]/[bottle size])+0.5,[c size]*[first count]/[bottle size])
TOTAL COUNT3: IIf(([c size]*[first count]/[bottle size]-Int([c size]*[first
count]/[bottle size])) Between 0 And 0.25,Int([c size]*[first count]/[bottle
size]),[c size]*[first count]/[bottle size])
See if we can help me to have this expresisons or a better one in one column.
KARL DEWEY said:
You have a calulated field and then some data that is not related to the
field.
Can you provide more information?
ft said:
I'm trying to convert the results of an expression but I can't seem to get it
right and I don't know if its possible to do the way I'm going about it. I
also want to be able to print a report which I have created using the data
from the query.
t bottles: ([c size]*[first count])/[bottle size]
LESS THAN ONE (1) ENTER 0.5
FROM 1.0 TO 1.25 ENTER 1
FROM 1.26 TO 1.75 ENTER 1.5
FROM 1.76 TO 2 ENTER 2
Can someone help?