简体   繁体   中英

SSRS syntax error with countdistinct iif

I have an SSRS report where I want to count specific results from the larger query (Overall Total - then of those total "Open" and total "Closed"). I'm trying to use the expression:

=CountDistinct(IIF(Fields!CaseStatusCode.Value='OPEN', Fields!CaseID.Value, Nothing))

But whenever I run the report I get:

There is a syntax error in the Value expression for the textrun 'Textbox24.Paragraphs[0].TextRuns[0]': ')' expected.

I've added and removed multiple ) but the error persists. I've also tried the expression in different textboxes and the error continues (just changing the name of the textbox it's in). What am I missing?

Solved it. Apparently I am supposed to use " instead of '. Corrected code below.

=CountDistinct(IIF(Fields!CaseStatusCode.Value="OPEN", Fields!CaseID.Value, Nothing))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM