I need positive integers only!

  • Thread starter Thread starter Cameron Sutherland
  • Start date Start date
C

Cameron Sutherland

Here is a bit a a hack but...
FixedValue:CInt((Abs([Quantity]) + [Quantity]) / 2)

Explanation:
(Abs([Quantity]) + [Quantity]) / 2)
The Abs returns positive of any value put in. The add and
division does your rule about making any negative value a
0. CInt returns only the whole number and rounds the
decimals.

-Cameron Sutherland
 
So long as your field is actually called "Quantity" you can
copy/paste...
FixedValue:CInt((Abs([Quantity]) + [Quantity]) / 2)

....into a column of your query. This will give you a new column/field
in the results called FixedValue. Isn't that what you needed?
-Cameron Sutherland

ExcessAccess said:
Where do I enter this?

~J

-----Original Message-----
Here is a bit a a hack but...
FixedValue:CInt((Abs([Quantity]) + [Quantity]) / 2)

Explanation:
(Abs([Quantity]) + [Quantity]) / 2)
The Abs returns positive of any value put in. The add and
division does your rule about making any negative value a
0. CInt returns only the whole number and rounds the
decimals.

-Cameron Sutherland
.
 
Back
Top