我有SSRS报告,如果值介于50和65之间,则我希望给出“已接受”,如果值介于65和75之间,则希望给出“好”;如果值介于75和85之间,则希望给出“ V好”,如果值介于75和85之间,则给出“优秀”。 85和100我该怎么办我的代码:
=(IIF(Fields!marks.Value >50, "fail", 0)) And (IIF(Fields!marks.Value <65, "Accepted", 0))
您可以使用Switch
函数来完成此操作:
=Switch(
Fields!marks.Value < 50, "fail",
Fields!marks.Value < 65, "accepted",
Fields!marks.Value < 75, "good",
Fields!marks.Value < 85, "v good",
True, "excellent"
)
您想要的是一个switch语句:
=switch(
Fields!marks.Value<50,"Fail",
Fields!marks.Value>= 50 and Fields!marks.Value<65,"Accepted",
Fields!marks.Value>= 65 and Fields!marks.Value<75,"Good",
Fields!marks.Value>= 75 and Fields!marks.Value<85,"V Good",
Fields!marks.Value>= 85 and Fields!marks.Value<100,"Excellent",
,"")