Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Charcter selection in codes

Status
Not open for further replies.

MikeCitizens

Technical User
Aug 13, 2002
37
US
Hello,
I have 8 or 11 digit codes that I need to pull the 5 and 6 character out of in order to complete a formula.

say the code is AEIBUS33
I need to pull the US out so I can do an If/Then statement to transalate US=United States.

say the code is HSBCHKHHHKH
I need to pull the HK out to transalate HK=Hong Kong

I know what I need to do is something with the word Left but I can remember exactly what the formula language is.

Any help on this simple formula is appreciated.
I know I should know this.
(getting ready to slap head and say DOH! after seeing the answer)

Mike
 
This is if you need the second HK that appears if the length is 11...

if length({table.field}) = 8 then
mid({table.field},5,2)
else if length({table.field}) = 11 then
mid({table.field},9,2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top