web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Formating single line of text field inside SSRS report

(0) ShareShare
ReportReport
Posted on by

I have a field with fixed length of 20 characters. Field type is Single Line of Text.

ABCD1234ABCD1234ABCD

I would like to split this string in 5 different pieces like this ABCD 1234 ABCD 1234 ABCD.
One empty space after every 4 characters. This string has no any delimiter, it's only letters and numbers.

Could this maybe be achieved by using standard format function?

 
I have the same question (0)
  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Formating single line of text field inside SSRS report

    Hi,

    Thank you for your query.

    As you do not have any delimiter, you can split.

    Because the length is fixed, you can use MID function in SSRS which is equivalent to SUBSTRING.

    Here us the example expression:

    =MID(Fields!StringData.Value, 1, 4) & " "
    & MID(Fields!StringData.Value, 5, 4) & " "
    & MID(Fields!StringData.Value, 9, 4) & " "
    & MID(Fields!StringData.Value, 13, 4) & " "
    & MID(Fields!StringData.Value, 17, 4)

    This shows following output:

    pastedimage1618999471538v1.png

    You can also use the same expression to show this in separate columns:

    pastedimage1618999509945v2.png

    If you are using this value multiple times in the report, it is better to do it in the SQL query:

    SELECT CONCAT(  SUBSTRING('ABCD1234ABCD1234ABCD', 1, 4), ' ',
                    SUBSTRING('ABCD1234ABCD1234ABCD', 5, 4), ' ',
                    SUBSTRING('ABCD1234ABCD1234ABCD', 9, 4), ' ',
                    SUBSTRING('ABCD1234ABCD1234ABCD', 13, 4), ' ',
                    SUBSTRING('ABCD1234ABCD1234ABCD', 17, 4)
    ) AS FormattedValue

  • Community Member Profile Picture
    on at
    RE: Formating single line of text field inside SSRS report

    This is exactly the function that was needed. Thanks a lot Wahaj. I was not aware that this function exist.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 247

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 166 Super User 2025 Season 2

#3
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 164

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans