Monday, March 26, 2012

Mod operation

Hi
I have a field that holds an integer value. I want to only show the value
of a remainder if there is one.
=Fields!IDCount.Value, Mod 2
What I am looking for is if the number is not even, then by having a
remainder when dividing by two will prove it is an odd number.
I keep getting the message "The value expression for the field
â'=(Fields!IDCount.Value, Mod 2)â' contains an error: [BC30198] ')' expected".
Any help would be greatI think you need something like the following as an expression for that
field;
=Iif (Fields!IDCount.Value Mod 2,
Code.RemainderHelp(Fields!IDCount.Value, 0),
Code.RemainderHelp(Fields!IDCount.Value,1))
So you would have a function in the custom code area called
RemainderHelp which formatted the output approprately depending on if
you passed in 0 or 1. I think something like that might work.
Make sense?

No comments:

Post a Comment