instr function in Reporting Services 2005

  • I'm trying to check if a parameter passed into the report is in a field in a report dataset using the instr function (although Books online 2008 doesn't have this text function it is in the expression builder). The parameter is a string parameter, and the field returned is a varchar (returned from an sp).

    Whenever i just put the instr function in the table it returns the integer value i expect, but when i nest it in an IIF and return the field i want to i get a blank.

    Does anyone know what is going on. This is driving me crazy.

    In the Books Online 2008 i have it says there is a FIND function. Maybe this is a known bug and was fixed by replacing the instr function? Although this won't help as we aren't upgrading to 2008 for a few months at least.

    Any help would be much appreciated,

    Matt

  • Actually it is #Error i am getting not a blank.

    I'm thinking i may need to do some data type conversion in the expression.

  • I've actually found my problem and it wasn't the instr function at all. That worked fine.

    It was a second condition in the IIF statement that was comparing an integer to a string and when both were blank or null it was returning an error - solution using CStr to convert int field.

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

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