IIF声明中的多个条件

时间:2015-07-09 03:12:47

标签: reporting-services iif

我有一个包含以下字段和数据的表:

Offense, Year, Month, Count, Amount

 F 2007 January 11 $49,238.00
 F 2007 February 12 $24,000.00
 F 2007 March 31 $55,184.00
 F 2007 April 19 $64,647.00
 F 2007 May 33 $100,010.00
 F 2007 June 16 $59,678.00
 F 2007 July 22 $39,700.00
 F 2007 August 3 $9,000.00
 F 2007 September 4 $75,000.00
 F 2007 October 8 $19,250.00
 F 2007 November 50 $106,153.00
 F 2007 December 26 $80,000.00

我有2007 - 2014年的数据和设计SSRS报告,并希望使用IIF语句来返回数据。使用以下内容:

=IIF(Fields!Year.Value="2007" AND Fields!Month.Value="February", Fields!Count.Value, "n/a")

以上操作不起作用,它不会返回Count字段的值,它会返回n/a

我正在寻找以下结果。

If Year = 2007 and Month = February, Count will = 12

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

=IIF(Fields!Year.Value=2007 AND Fields!Month.Value="February", CSTR(Fields!Count.Value), "n/a")