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 |
|
Anand.A
Posting Yak Master
109 Posts |
Posted - 2012-03-09 : 07:41:49
|
| hii create report in ssrsin that report i want to write expressionlikeMonth_number is in (2,4)andCustomer_id in( 23,56,89)how to write iif expression for this so my expression statisfy this 2 conditionex:i wrote a expression like thisThis Correct :=iif(DateDiff("M",Fields!TIME_DATE.Value,Now())=6and DateDiff("M",Fields!TIME_DATE.Value,Now())=12and Fields!Customer_id .Value=2and Fields!Customer_id .Value=3and Fields!Customer_id .Value=6and Fields!Customer_id .Value=7,Fields!TRANSACTION_AMOUNT.Value,NOTHING)anand |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-03-09 : 08:11:44
|
You have to use a combination of And and Or keywords as appropriate, keeping in mind to use brackets as appropriate. In your example, this may be what you need:=iif((DateDiff("M",Fields!TIME_DATE.Value,Now())=6or DateDiff("M",Fields!TIME_DATE.Value,Now())=12)and (Fields!Customer_id .Value=2or Fields!Customer_id .Value=3or Fields!Customer_id .Value=6or Fields!Customer_id .Value=7),Fields!TRANSACTION_AMOUNT.Value,NOTHING) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-09 : 11:08:03
|
quote: Originally posted by Anand.A hii create report in ssrsin that report i want to write expressionlikeMonth_number is in (2,4)andCustomer_id in( 23,56,89)how to write iif expression for this so my expression statisfy this 2 conditionex:i wrote a expression like thisThis Correct :=iif(DateDiff("M",Fields!TIME_DATE.Value,Now())=6and DateDiff("M",Fields!TIME_DATE.Value,Now())=12and Fields!Customer_id .Value=2and Fields!Customer_id .Value=3and Fields!Customer_id .Value=6and Fields!Customer_id .Value=7,Fields!TRANSACTION_AMOUNT.Value,NOTHING)anand
the above expression and your explanation are not the sameBut you should be able to use expression in simlar lines------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|