Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bendertez
Yak Posting Veteran
94 Posts |
Posted - 2010-09-21 : 09:08:57
|
Hi I have a simple expression which looks at two value fields (one current and one from the previous month) and does a comparison so I can see the rise or fall of the value on a month to month basis. This currently works okay:=(Fields!PreviousTotal.Value)-(Fields!CurrentTotal.Value)However sometimes there isn't a previous months value (i.e. from a new account) which then gives just me the amount of the current value as there is nothing to take away.What I really want is a null value returning where there is no PreviousTotal rather than the difference.Can this be done within the expression?Thanks in advanceDave |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-21 : 12:25:19
|
=IIF(Len(Fields!PreviousTotal.Value)>0,(Fields!PreviousTotal.Value)-(Fields!CurrentTotal.Value),Nothing)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
bendertez
Yak Posting Veteran
94 Posts |
Posted - 2010-09-24 : 08:50:31
|
Thanks Visakh, that's worked perfectly. |
|
|
|
|
|