Calculation Question

S

StuJol

using vb in access2003 i get various values like 503, 1202, 1234

i need to know how many 500's are in the number and then the remainder

for example 503 = 1 * 500 with a remainder of 3
1202 = 2 * 500 with a remainder of 2
1234 = 2 * 500 with a remainder of 34

has anyone any ideas please
 
J

John Spencer

Use the integer divisor "\" and the Mod operator.

503 \ 500 = 1 (Yes that "\" is correct)

To get the remainder
503 Mod 500 = 3

or

503 -(503 \ 500) * 500
 
S

StuJol

didnt know about the mod function, many thanks


John Spencer said:
Use the integer divisor "\" and the Mod operator.

503 \ 500 = 1 (Yes that "\" is correct)

To get the remainder
503 Mod 500 = 3

or

503 -(503 \ 500) * 500
 
Top