Strange. Seems to not like using Part or Left. You can probably look at something like:

var text t = "DTWWN11111111";

If(

Right(Left($t,6),2)="WN",Left($t,4),

Right(Left($t,5),2)="WN",Left($t,3),

Right(Left($t,4),2)="WN",Left($t,2),

Right(Left($t,3),2)="WN",Left($t,1),

"")

Basically look at the first 6 characters - if the last two are WN - get everything to the left, if its not WN - look at the first 5, trying to find a WN.

Chayce Duncan | Technical Lead

(720) 739-1406 |

chayceduncan@quandarycg.comQuandary Knowledge Base