我有一个Crystal Report,我正在转换为SSRS,并且有一个重要的函数,它有多个ELSE IF语句。有没有办法让它在ssrs中运行?
IF ({Command.FOLDERTYPE}= 'PC' and
//1950 - SUB - MAJ FACILITIES SUBDIVISION, 1260 - SUBDIVISION
({Command.SUBCODE} = 1950) or {Command.SUBCODE} = 1260)
OR (({Command.FOLDERTYPE} = 'GD' and {Command.SUBCODE} = 900) //900 - Public Construction
or ({Command.FOLDERTYPE} = 'WA' and {Command.SUBCODE} = 900)
or ({Command.FOLDERTYPE} = 'SS' and {Command.SUBCODE} = 900)
or ({Command.FOLDERTYPE} = 'SD' and {Command.SUBCODE} = 900)
or ({Command.FOLDERTYPE} = 'ST' and {Command.SUBCODE} = 900)) THEN
'Subdivision'
ELSE IF ({Command.FOLDERTYPE} = 'CO')
OR (({Command.FOLDERTYPE} = 'WA' and {@SubtypeCommercial} = true)
or ({Command.FOLDERTYPE} = 'SS' and {@SubtypeCommercial} = true)
or ({Command.FOLDERTYPE} = 'SD' and {@SubtypeCommercial} = true)
or ({Command.FOLDERTYPE} = 'ST' and {@SubtypeCommercial} = true)
or ({Command.FOLDERTYPE} = 'PC' and {@SubtypeCommercial} = true)
or ({Command.FOLDERTYPE} = 'GD' and {@SubtypeCommercial} = true)) THEN
'Commercial'
ELSE IF ({Command.FOLDERTYPE} = 'SF')
OR (({Command.FOLDERTYPE} = 'WA' and {Command.SUBCODE} = 1210) //1210 - singe family
or ({Command.FOLDERTYPE} = 'SS' and {Command.SUBCODE} = 1210)
or ({Command.FOLDERTYPE} = 'SD' and {Command.SUBCODE} = 1210)
or ({Command.FOLDERTYPE} = 'ST' and {Command.SUBCODE} = 1210)
or ({Command.FOLDERTYPE} = 'GD' and {Command.SUBCODE} = 1210)) THEN
'Single Family'
ELSE IF {Command.FOLDERTYPE} = 'II' OR ({Command.FOLDERTYPE} = 'FR') THEN
'Miscellaneous'
ELSE IF {Command.FOLDERTYPE} = 'GD' THEN
'Grading Permit - No subtype'
答案 0 :(得分:1)
是的,最简单的方法是在表达式中使用嵌套的iif:
=iif([first condition], [result if true], iif([second condition], [result if first condition not true, and 2nd is true], [result if neither are true))
显然只有两个条件,但你可以继续以相同的方式嵌套iif语句。