My Assistant
MOD function


Nov 7 2007, 02:43 PM
Post
#1


UtterAccess Addict Posts: 109 From: York, PA 
I'm trying to use the MOD function in a query and no matter what I do, I get an error telling me that I'm using invalid syntax. When I look up the function in help, it doesn't appear. It was available in Access 97. Is it no longer available?



Nov 7 2007, 02:56 PM
Post
#2


UA Forum Administrator Posts: 39,217 From: Birmingham, Alabama USA 
Mod is an Operator ...
It would help us if we knew how you were using the Operator ... Post the expression you are using ... RDH 


Nov 7 2007, 03:04 PM
Post
#3


UtterAccess Guru Posts: 823 From: Midwest 
12 Mod 5 = 2
Operator as in takes the place of the division (/) operator! 


Nov 7 2007, 03:26 PM
Post
#4


UtterAccess Addict Posts: 109 From: York, PA 
I'm trying to calcualate even spacing of holes over a distance and I also need the qty of spaces. I've got locations for starting hole, X, and ending hole, Y, and the minimum spacing, Z. My problem is that I was trying to use Mod as a function like this: # of Spaces = IIF(Mod((YX)/Z,1)>0,(YX)/Z,Int((YX)/Z)+1). I may not have the syntax for Mod correct, because I can't find the syntax anywhere. I have a Mastering Access 97 book that only shows that MOD exists, with no examples of how to use it. Thanks for you help!



Nov 7 2007, 03:41 PM
Post
#5


UA Forum Administrator Posts: 39,217 From: Birmingham, Alabama USA 
Again ... Mod is an "Operator" not a Function.
Your usage of this Operator is not correct. QUOTE The modulus, or remainder, operator divides number1 by number2 (rounding floatingpoint numbers to integers) and returns only the remainder as result. For example, in the following expression, A (result) equals 5. A = 19 Mod 6.7 RDH 


Nov 7 2007, 06:06 PM
Post
#6


UtterAccess Guru Posts: 823 From: Midwest 
What are these holes? Maybe there's a better way to get what you want.



Search · Go to Top · LoFi Version  Time is now: 18th April 2014  11:35 PM 