Doing a Divide Need The Whole Part Only...

  • Thread starter Thread starter Muse
  • Start date Start date
M

Muse

Say I'm dividing 12/5 the answer is 2.4. I need access to return only 2 and
ignore the remainder. Is there a function that does this?
 
Say I'm dividing 12/5 the answer is 2.4. I need access to return only 2 and
ignore the remainder. Is there a function that does this?

Use Integer division (\).

?12/5
2.4
?12\5
2
 
Muse said:
Say I'm dividing 12/5 the answer is 2.4. I need access to return only 2 and
ignore the remainder. Is there a function that does this?


Try using the integer divide operator \

12 \ 5 the answer is 2
 
You can use the INT function or the \ integer division operator if your
numbers are always whole numbers (no decimal portion).

Int(12/5) and 12\5 will both return 2

HOWEVER, if your numbers can contain decimal portions then you need to be
aware that Int and integer division can return different results. For instance

?11.41\5.7 Returns 1
?11.41/5.7 returns 2.00175438596491
?Int(11.41/5.7) returns 2


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top