Hi, I have requirement where if the record are 1,15,201...then the output should be 1,15,501....that is if the number is 3 digit then the 1st digit needs to be changed to 5.
Please suggest....
Thanks...
Modify the 1st digit
Moderators: chulett, rschirm, roy
Is this 3 different columns or one string of value "1,15,201"? or 3 different values for one column?
Assuming the latter, "IF LEN(In.Col)=3 THEN '5':In.Col[2,2] ELSE In.Col"
Assuming the latter, "IF LEN(In.Col)=3 THEN '5':In.Col[2,2] ELSE In.Col"
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Something like
Code: Select all
svYourNumLen = len(yourNum)
If svYourNumLen >= 3 Then yourNum[1,svYourNumLen-3] : '5' : yourNum[yourNumLen - 2, 2] Else yourNum