MOD (Modulus) returns the remainder of a division of the first operand by the second. It is very useful to extract part of a numeric field, and used in conjunction with subtraction and division, the MOD operation is like a numeric equivalent to the substring function.

These example shows how to use MOD to extract parts of a MMDDYY numeric date.

122506 MOD 10 = 6
122506 MOD 100 = 06 
122506 MOD 10000 = 2506 
122506 - (122506 MOD 10000) = 120000 
122506 MOD 10000 - 122506 MOD 100 = 2500

 

See Also:

Create a Sequence Number in Your View Results

Remove Non-alpha Characters From a String

 


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: April 21, 2017