SSRS Format Expression w/ Dashes
I have a filename field that contains text such as: data/0123456789ABCDEFG.txt Does someone know of an expression that can format it as this: data/0123456789ABCDEFG/0123456789-AB-CDEFG.index.htm ? So, it would be adding the original field again and formatting it with dashes? Hope that makes sense.... Thanks! I hear and I forget. I see and I remember. I do and I understand.
October 27th, 2010 12:07pm

hello, this should work (replace the parameter rrr with your field) also this assumes your field will always have that format =Parameters!rrr.Value & mid(Parameters!rrr.Value, 5, 11) & "-" & mid(Parameters!rrr.Value, 16, 2) & "-" & mid(Parameters!rrr.Value, 18, 6) & "index.htm"
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2010 12:28pm

Thanks, Nehemiah - It almost works, but some of the filenames have more characters than others (and I'd have to "replace" some of the /s and -s). I did it this way: =mid(Fields!Filename.Value, 1,37) & "/" & mid(Fields!Filename.Value, 12,25) & "-" & "index.htm" There must be some other way!I hear and I forget. I see and I remember. I do and I understand.
October 27th, 2010 1:52pm

what extra characters would be in the field? maybe there's still a pattern there to create an expression for all cases
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2010 3:21pm

My fields have data such as this (42-43 characters each): xxxxx/data/1081206/0001204459-10-002532.txt xxxxx/data/109758/0001299933-10-003786.txt xxxxx/data/1179929/0001157523-10-006104.txt xxxxx/data/1267201/0001140361-10-042269.txtI hear and I forget. I see and I remember. I do and I understand.
October 27th, 2010 4:21pm

you can use an iif statement to handle when format the field a different way the length of the field is an extra character
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2010 7:39pm

Can you give me an example? Thanks.I hear and I forget. I see and I remember. I do and I understand.
November 9th, 2010 1:43pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics