Question/Issue

I have a string that contains the entire legal description of a location (Township, Range, Section, and Subsection). An example is: T36SR01W36NESE. I am trying to use an Expression for each of the 4 fields to extract the data within the report builder, not through SQL language creating the dataset. 

Normally, this would be easy to use the LEFT function but the numbers between the T & S and between the R & W aren't always padded with the leading 0. In addition, the last 4 showing NESE is sometimes only two characters (SW, SE, NW, NE). What I'm trying to figure out is how to get them to be 4 separate fields:

Township: T36S

Range: R01W

Section: 36

SubSection: NESE

Township will always begin with T and ending with S or N

The range will always begin with R end with E or W

The section is always 2 digit (although I'm not sure the lower numbers have the leading 0 all the time)

Solution

Township=Mid("T36SR01W36NESE",InStr("T36SR01W36NESE", "T"),IIF(InStr("T36SR01W36NESE", "S")>InStr("T36SR01W36NESE", "N"),InStr("T36SR01W36NESE", "N"),InStr("T36SR01W36NESE", "S")))
 
Range=Mid("T36SR01W36NESE",InStr("T36SR01W36NESE", "R"),IIF(InStr("T36SR01W36NESE", "E")>InStr("T36SR01W36NESE", "W"),InStr("T36SR01W36NESE", "W"),InStr("T36SR01W36NESE", "E"))-InStr("T36SR01W36NESE", "R")+1)
 
Section=Mid("T36SR01W36NESE",Len(Mid("T36SR01W36NESE",InStr("T36SR01W36NESE", "T"),IIF(InStr("T36SR01W36NESE", "S")>InStr("T36SR01W36NESE", "N"),InStr("T36SR01W36NESE", "N"),InStr("T36SR01W36NESE", "S")))&Mid("T36SR01W36NESE",InStr("T36SR01W36NESE", "R"),IIF(InStr("T36SR01W36NESE", "E")>InStr("T36SR01W36NESE", "W"),InStr("T36SR01W36NESE", "W"),InStr("T36SR01W36NESE", "E"))-InStr("T36SR01W36NESE", "R")+1))+1,2)
 
SubSection=Mid("T36SR01W36NESE",Len(Mid("T36SR01W36NESE",InStr("T36SR01
W36NESE", "T"),IIF(InStr("T36SR01W36NESE", "S")>InStr("T36SR01W36NESE", "N"),InStr("T36SR01W36NESE", "N"),InStr("T36SR01W36NESE", "S")))&Mid("T36SR01W36NESE",InStr("T36SR01W36NESE", "R"),IIF(InStr("T36SR01W36NESE", "E")>InStr("T36SR01W36NESE", "W"),InStr("T36SR01W36NESE", "W"),InStr("T36SR01W36NESE", "E"))-InStr("T36SR01W36NESE", "R")+1))+3,4)

Integration of this code into SSRS

Township =Mid(Fileds!Dataset.VALUE,InStr(Fileds!Dataset.VALUE, "T"),IIF(InStr(Fileds!Dataset.VALUE, "S")>InStr(Fileds!Dataset.VALUE, "N"),InStr(Fileds!Dataset.VALUE, "N"),InStr(Fileds!Dataset.VALUE, "S")))
 
Range=Mid(Fileds!Dataset.VALUE,InStr(Fileds!Dataset.VALUE, "R"),IIF(InStr(Fileds!Dataset.VALUE, "E")>InStr(Fileds!Dataset.VALUE, "W"),InStr(Fileds!Dataset.VALUE, "W"),InStr(Fileds!Dataset.VALUE, "E"))-InStr(Fileds!Dataset.VALUE, "R")+1)
 
Section=Mid(Fileds!Dataset.VALUE,Len(Mid(Fileds!Dataset.VALUE,InStr(Fileds!Dataset.VALUE, "T"),IIF(InStr(Fileds!Dataset.VALUE, "S")>InStr(Fileds!Dataset.VALUE, "N"),InStr(Fileds!Dataset.VALUE, "N"),InStr(Fileds!Dataset.VALUE, "S")))&Mid(Fileds!Dataset.VALUE,InStr(Fileds!Dataset.VALUE, "R"),IIF(InStr(Fileds!Dataset.VALUE, "E")>InStr(Fileds!Dataset.VALUE, "W"),InStr(Fileds!Dataset.VALUE, "W"),InStr(Fileds!Dataset.VALUE, "E"))-InStr(Fileds!Dataset.VALUE, "R")+1))+1,2)
 
SubSection=Mid(Fileds!Dataset.VALUE,Len(Mid(Fileds!Dataset.VALUE,InStr(Fileds!Dataset.VALUE, "T"),IIF(InStr(Fileds!Dataset.VALUE, "S")>InStr(Fileds!Dataset.VALUE, "N"),InStr(Fileds!Dataset.VALUE, "N"),InStr(Fileds!Dataset.VALUE, "S")))&Mid(Fileds!Dataset.VALUE,InStr(Fileds!Dataset.VALUE, "R"),IIF(InStr(Fileds!Dataset.VALUE, "E")>InStr(Fileds!Dataset.VALUE, "W"),InStr(Fileds!Dataset.VALUE, "W"),InStr(Fileds!Dataset.VALUE, "E"))-InStr(Fileds!Dataset.VALUE, "R")+1))+3,4)