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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case number problem

Status
Not open for further replies.

cjany

IS-IT--Management
Nov 3, 2004
72
0
0
US
I am breaking does case numbers that are in many different lengths and ranges. I have most of the case numbers broken down, but now I'm having a problem converting my year field to differentiate between case numbers from 1999 and under and 2000 and over.

Here are my examples:

GV101549 converted to GV01001549 (this works)

GV9300521 should covert to GV9300521 (this does not work)

Here is my code:

if mid(ToNumber({TXEVNTD.EI2CASNUM},3,2)< 50) then
(If Len({TXEVNTD.EI2CASNUM})=7 then
"00" else
If Len({TXEVNTD.EI2CASNUM})=8 then
"0"& trim(mid(totext({TXEVNTD.EI2CASNUM}),3,1))else
If len({TXEVNTD.EI2CASNUM})=9 then
"0" & trim(mid(totext({TXEVNTD.EI2CASNUM}),4,1))else
if len({TXEVNTD.EI2CASNUM})=10 then
trim(mid(totext({TXEVNTD.EI2CASNUM}),3,2))else
if len({TXEVNTD.EI2CASNUM})=11 then
trim(mid(totext({TXEVNTD.EI2CASNUM}),3,2)))
 
You need to explain what different parts of the code are supposed to represent. Also note that your example for "does not work" probably contains a mistake, since both codes are the same.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top