Query to find integer

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

All,

I have two fields A & B. I want a query to output a
record if A/B is not an interger value. Does anyone know
how to do this?

TIA
Chris
 
The MOD operator takes two values and returns the remainder of the
first divided by the second. So, if you then compare that value to 0
you will know whether B is a factor of A. Put the following in one of
the columns of your query grid. If it is a factor, the value will
be -1(True), otherwise 0 (False).

Factor:(A MOD B) = 0

--
HTH

Dale Fye


All,

I have two fields A & B. I want a query to output a
record if A/B is not an interger value. Does anyone know
how to do this?

TIA
Chris
 
That works ASSUMING that A and B are integers. For numbers with decimal portions
I think I would try:

IntegerValue: A/B = CLng(A/B)

That should return true or false, also. But floating point numbers will be
problematic depending on the degree of accuracy you require. So the following
might be more accurate (or less)

IntegerValue: Abs(A/B - CLng(A/B)) <= .0000000001
 
Back
Top