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.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Cannot get an expression to work

Author  Topic 

rkalyani
Starting Member

30 Posts

Posted - 2009-04-17 : 15:50:23
I have a text box in my report which I am trying to filter using this expression.

="Sales " & Sum(iif(Fields!coci_id.Value= "006602BC",1,0))

The result is always 0 but I know from the query I run that there are records which has this value. Can some one tell me what I am doing wrong.

Thank you

Thank you,
kal30

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-17 : 16:40:21
What datatype is coci_id column?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

shekhar
Starting Member

3 Posts

Posted - 2009-04-18 : 08:21:33
kal30,

Can you try the below Expression

="Sales " & CSTR(Sum(iif(Fields!coci_id.Value= "006602BC",1,0)))
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-18 : 14:31:44
="Sales " & Sum(iif(CSTR(Fields!coci_id.Value) = "006602BC", 1, 0))


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-18 : 15:09:36
quote:
Originally posted by rkalyani

I have a text box in my report which I am trying to filter using this expression.

="Sales " & Sum(iif(Fields!coci_id.Value= "006602BC",1,0))

The result is always 0 but I know from the query I run that there are records which has this value. Can some one tell me what I am doing wrong.

Thank you

Thank you,
kal30


are you sure
1.coc_id is string type
2.coc_id doesnt have any unwanted space before or after value 06602BC
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-19 : 03:06:51
Or is binary?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

rkalyani
Starting Member

30 Posts

Posted - 2009-04-20 : 13:33:51
Thank you so much for your help. I had to use Trim on my database field to get the right answer.

Thank you,
kal30
Go to Top of Page
   

- Advertisement -