Calculation Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top