Friday, June 29, 2018

SSRS - How return substring only to first occurrence of specified char

When field ItemId contains for example value "ABC-156032_0_0000" and you want only first part of this string to first occurrence of "_" char, use this code for expression:
=Mid( First( Fields!ItemId.Value, "ProdRouteCardDS" ), 
1, InStr( First(Fields!ItemId.Value, "ProdRouteCardDS" ), "_" ) - 1 )
Output will be:
ABC-156032

No comments:

Post a Comment