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 |
syd_bloke
Starting Member
6 Posts |
Posted - 2005-06-09 : 00:44:44
|
Hi,I have two fields ActualSales and ActualGP from a stored procedure, I added another column in report layout and called it Actual %TC, the expression for Actual %TC is =Sum(Fields!ActualGP.Value) / Sum(Fields!ActualSales.Value) * 100, which gives me the Actual %TC correctly, but it also generates NAN values, how can I change NAN to 0.Thanks in advance |
|
raclede
Posting Yak Master
180 Posts |
Posted - 2005-06-09 : 00:59:34
|
use ISNULL(YourField,0)or COALESCE(YourField,0)"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside. " raclede |
 |
|
syd_bloke
Starting Member
6 Posts |
Posted - 2005-06-09 : 01:57:54
|
I beleive that will work with T-Sql, however, I would like to work it inside a report in Reporting Services. I have noticed Tara's explaination of:= IIF(Len(Fields!DriverGroup.Value) < 1, "<No Driver Group>", Fields!DriverGroup.Value)I would like to know how can I combine these expressions to get rid off Null values. Thanks for your response |
 |
|
jhermiz
3564 Posts |
Posted - 2005-06-09 : 08:48:14
|
syd_bloke,use an AND condition within that iif len...to check both conditions.Or you can do this on the database side of things as well by using CASE. Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url] |
 |
|
syd_bloke
Starting Member
6 Posts |
Posted - 2005-06-13 : 04:17:05
|
Thanks jhermiz, I got rid off by creating a custome code. |
 |
|
|
|
|
|
|