all groups > sql server reporting services > july 2007 >
You're in the

sql server reporting services

group:

IF...Then...Else expression


RE: IF...Then...Else expression Michael C
7/30/2007 3:48:02 PM
sql server reporting services:

If you are using this in a report control you should be using IIf(), or
Immediate If, such as:

=IIf(Sum(Fields!HRS.Value) * 14.04 >
Sum(Fields!AMT_EARNED.Value),(Sum(Fields!HRS.Value) * 14.04) -
Sum(Fields!AMT_EARNED.Value),"0")

[quoted text, click to view]
Re: IF...Then...Else expression Norman Yuan
7/30/2007 3:52:35 PM
You want a field's value on the report equals to the result of the
expression, right? If so:

1. Use IIF(condition, expression1, expression2);
2. Do not use square braket "[" "]".

For example:

=IIF(Sum(Fileds!HRS.Value)*14.04 > Sum(Fileds!AMT_EARNED.Value),
Sum(Fields!HRS.Value)*14.04-Sum(Fields!AMT_EARNED.Value,0)


[quoted text, click to view]

IF...Then...Else expression abz
7/30/2007 10:39:14 PM
Hello everyone, I'm having trouble writing an IF...Then...Else
expression. I'm still new at vb so all help available is helpful. So
far this is what I have.

=IF [Sum(Fields!HRS.Value) * 14.04] > [Sum(Fields!AMT_EARNED.Value)]
THEN
[Sum(Fields!HRS.Value) * 14.04] - [Sum(Fields!AMT_EARNED.Value)]
Else= "0"

Any suggestions???? Corrections more likely....help,
pleeeaaseee....this is the only thing holding me back from finishing a
report on SSRS 2000.

Thanks,
Abner
Re: IF...Then...Else expression abz
8/1/2007 12:00:00 AM
[quoted text, click to view]

Thank you very much for your help but it still gives me an
error......what I want it to do is if the sum of HRS field * 14.04 is
greater than the sum of AMT_EARNED, Then to multiply 14.04 by the sum
of HRS and all that subtracted by the sum of AMT_EARNED.........but if
the sum of AMT_EARNED is Greater then just display a zero.....
AddThis Social Bookmark Button