none
Split a string into a split value from an already split string possible?

    Question

  • Hi

    I have a large string which is input into a field then processed later, from this string I need to generate a report. My problem here is to split only one portion of the string, then re-split this portion so it can be shown on the report. 

    My string: 

    SEV.ORI/999999.VIN/1D7Hx11111111111111.VYR/2005.VMA/DODG.VMO/THU.DOT/07072013.CRT/MI1111111.OCA/11111111890123000001.LIT/PC.LIC/BFK9331

    I want to split DOT and leave only the date 07072013

    If I do 

    =Split(Fields!MESSAGE.Value.ToString,"/")(6)

    I get 07072013.CRT

    1) How can I delimit to only get 07072013

    2) How could I split the string to show as 07/07/2013

    Any help would be greatly appreciated as I do not have great experience with SSRS. 

    Tuesday, January 07, 2014 5:34 PM

Answers

  • So I finally got it

    After a couple of hours of trying. Posting the expression maybe it can help someone else in the future :) 

    Also if there is a better or simpler way to do this I´m open for suggestions :) 

    =Left(Split(Fields!MESSAGE.Value,"/")(6),2) + "/" 
    & Mid(Split(Fields!MESSAGE.Value, "/")(6) ,3 ,2) + "/" 
    & Mid(Split(Fields!MESSAGE.Value, "/")(6), 5, 4)

    • Marked as answer by Wickedmog Tuesday, January 07, 2014 11:31 PM
    Tuesday, January 07, 2014 10:49 PM

All replies

  • I almost get it

    been playing around with functions. 

    with this: 
    =Left(Split(Fields!MESSAGE.Value.ToString,"/")(6),8)

    I get: 

    07072013

    I just need to split it like 07/07/2013

    Tuesday, January 07, 2014 6:30 PM
  • So I finally got it

    After a couple of hours of trying. Posting the expression maybe it can help someone else in the future :) 

    Also if there is a better or simpler way to do this I´m open for suggestions :) 

    =Left(Split(Fields!MESSAGE.Value,"/")(6),2) + "/" 
    & Mid(Split(Fields!MESSAGE.Value, "/")(6) ,3 ,2) + "/" 
    & Mid(Split(Fields!MESSAGE.Value, "/")(6), 5, 4)

    • Marked as answer by Wickedmog Tuesday, January 07, 2014 11:31 PM
    Tuesday, January 07, 2014 10:49 PM
  • Hi Wickedmog,

    Thanks for your posting.

    I am glad to hear that you have resolved the issue and share the solution to the forum, it will be benefit for whom have similar issues to solve.

    Regards,
    Heidi Duan


    Heidi Duan
    TechNet Community Support

    Wednesday, January 08, 2014 8:24 AM
    Moderator