Report Builder 3.0 Font Color expression help

  • I'm trying to have the font change to red if the results from "EncounterPatient" are less than "Past". Any help is appreciated have been trying to figure this out for several hours today.

    =IIf(CountDistinct(Fields!PatientID.Value, "EncounterPatient")<(CountDistinct(Fields!PatientID.Value, "PAST"), "Red","Black"))

    This is the error I get.

    The Color expression for the textrun ‘PatientID16.Paragraphs[0].TextRuns[0]’ contains an error: [BC30198] ')' expected.

    ***SQL born on date Spring 2013:-)

  • The last right bracket is in the wrong place (and it and one other left bracket appear to be redundant)

    I think either of the following will work:

    =IIf(CountDistinct(Fields!PatientID.Value, "EncounterPatient")<(CountDistinct(Fields!PatientID.Value, "PAST")), "Red","Black")

    or

    =IIf(CountDistinct(Fields!PatientID.Value, "EncounterPatient")<CountDistinct(Fields!PatientID.Value, "PAST"), "Red","Black")

  • Thank You so much, the first one in had worked great.

    I would really like to understand why it worked. Do you know of any links or videos on when and where to use the parentheses in a function? I am still very new in SQL and would really like to understand the logic on things like this so I don't have to come bug you awesome dudes over here.:blush:

    Thanks Again,

    Thomas

    ***SQL born on date Spring 2013:-)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply