D.R.
D.R.

Reputation: 1219

SSRS computed value or a maximum value

I am computing a value (using some datediffs/dateadds), but I need to "cap" that value at 45. So for example, if the computed value were 78, it would still return only 45, however if the value is 31, then it would return 31. The MAX() function in SSRS is for finding the maximum of some column over many rows and that is NOT what I want. This is a computed value for ONE row that needs to be capped at 45. Any ideas?

**Note: I'd prefer not to do this in SQL itself because I am using it to change the "fill color" of a cell, but if that's the only way, I guess I can do that.

Upvotes: 0

Views: 175

Answers (1)

Tak
Tak

Reputation: 1562

=IIf(Fields!SomeField.Value <= 45,Fields!SomeField.Value, 45)

Thanks @D.R.

Upvotes: 2

Related Questions