"Startswith" alternative?

  • As you can see from the title I'm coming from Crystal and I've been searching for quite some time but can't find the equivalent to Crystal's "Startwith" expression.

    Just need to do a simple comparision.

    =IIF(Fields!Job.Value "Startswith" X,"X","X")

    What would the best way to do this be?

  • Hi ,

    Can you clearly mention what you are looking for..? Do you want to check whether the Field you specified starts with some string? If so try to user Left() function in the expression.

    =iif((Left(Field!Job.value ,3) = "XYZ"),Truepart,Falsepart)

    Thanks & Regards,
    MC

  • Works perfect. Wasn't sure how the left function would work in my expression as I was already using it. I basically needed it to return only the first five digits of a job number unless it started with "13". Here is what I ended up with:

    =iif((Left(Fields!Job.Value ,2) = "13"),left(Fields!Job.Value, 6),left(Fields!Job.Value, 5))

    Thanks for your help!

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

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