Monday, February 13, 2012

% remainder in SQL

In t-sql you can do the following to check if a value is odd or even. If it returns a 0 then the number is even, if it returns a 1 it is an odd number.
select @.Value%2

I need to do something similar in a backgroundColor expression in RS 2005, any ideas? I dont see any built-in function for this.

You could do something like this and just use the boolean result(pseudocode only, not tested)

(@.Value/2 = CInt(@.Value/2))

|||

Thanks csi_hugh

This works great!

No comments:

Post a Comment