Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Calculating Remainder in Report Writer


TechKnowledge Content

Question:

What is the MOD function used for in Report Writer?


Answer:

The MOD function in mathematics returns the remainder of a division. For example, 9 MOD 2 is 1, because 2 divides into 9 four times, with a remainder of 1. A few more examples are 9 MOD 4 = 1, 32 MOD 5 = 2, and 25 MOD 7 = 4.


This function can be expressed by the following formula where R is the remainder, N the numerator, and D the denominator:


R = N - ( D * int( N / D ) )


Using this function to calculate 43 MOD 4:


R = 43 - ( 4 * int( 43 / 4 ) ) = 3




This article was TechKnowledge Document ID:3804

↑ Back to the top


Keywords: kbnosurvey, kbmbspartner, kbmbsmigrate, kb

↑ Back to the top

Article Info
Article ID : 863319
Revision : 1
Created on : 3/25/2017
Published on : 12/30/2014
Exists online : False
Views : 86