Help on calculation

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

Guest

I am attempting to create a formula that returns a "random" number. I am
taking an IFF and using it to either return a blank if the referenced field
is blank, or do a MOD calculation inclusive of another field. The calulation
looks like this:

=IIF([SSNumber]="","",9-MOD([SumOfTheProduct],9))

I keep getting an error message saying:

The expression you entered contains invalid syntax.
You may have entered a comma without a preceding value or identifier.

When I drop the MOD statement or change it to a number it works properly. I
need to make this work - it does in excel. Any ideas?
 
MOD is an Excel function not an Access function (someone correct me if I'm
wrong!). MOD in Excel returns the remainder of, so kinda makes me unsure of
what you are trying to accomplish. Perhaps if you expalin what you are
trying to do in Access? it might help soemone get you a formula you can
use. However, if you are using Excel, I would suggest you post your
question to the Excel newsgroup.
 
Robb,
The MOD function syntax is...
FirstNo MOD SecondNo
So...
=IIF([SSNumber]="","",9-([SumOfProduct] MOD 9))
should do it.
 
Gina,
Access does have a MOD function.
The syntax is...
FirstNo MOD SecondNo
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Gina Whipp said:
MOD is an Excel function not an Access function (someone correct me if I'm
wrong!). MOD in Excel returns the remainder of, so kinda makes me unsure
of what you are trying to accomplish. Perhaps if you expalin what you are
trying to do in Access? it might help soemone get you a formula you can
use. However, if you are using Excel, I would suggest you post your
question to the Excel newsgroup.


Robb said:
I am attempting to create a formula that returns a "random" number. I am
taking an IFF and using it to either return a blank if the referenced
field
is blank, or do a MOD calculation inclusive of another field. The
calulation
looks like this:

=IIF([SSNumber]="","",9-MOD([SumOfTheProduct],9))

I keep getting an error message saying:

The expression you entered contains invalid syntax.
You may have entered a comma without a preceding value or identifier.

When I drop the MOD statement or change it to a number it works properly.
I
need to make this work - it does in excel. Any ideas?
 
Thank you for the correction! I have learned something new today!

Al Camp said:
Gina,
Access does have a MOD function.
The syntax is...
FirstNo MOD SecondNo
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Gina Whipp said:
MOD is an Excel function not an Access function (someone correct me if
I'm wrong!). MOD in Excel returns the remainder of, so kinda makes me
unsure of what you are trying to accomplish. Perhaps if you expalin what
you are trying to do in Access? it might help soemone get you a formula
you can use. However, if you are using Excel, I would suggest you post
your question to the Excel newsgroup.


Robb said:
I am attempting to create a formula that returns a "random" number. I am
taking an IFF and using it to either return a blank if the referenced
field
is blank, or do a MOD calculation inclusive of another field. The
calulation
looks like this:

=IIF([SSNumber]="","",9-MOD([SumOfTheProduct],9))

I keep getting an error message saying:

The expression you entered contains invalid syntax.
You may have entered a comma without a preceding value or identifier.

When I drop the MOD statement or change it to a number it works
properly. I
need to make this work - it does in excel. Any ideas?
 
Back
Top