Substring

Kenneth_Elder28

Member
Has anyone used SUBSTR succesfully in ER. I am trying to substring out the
first 5 characters of Tax Rate/Area in program P4210 and I CANNOT get it to
pick up the first character. I have tried the following statements and
neither work.

FC Tax Rate/Area = substr([FC Tax Rate/Area],0,5 )

and

FC Tax Rate/Area = substr([FC Tax Rate/Area],1,5 )


Any help would be appreaciated. Thanks.


______________________
Kenneth Elder
Lead Analyst
Hartmann, Inc.
Phone: (615)453-3220
Fax: (615)443-4619

NT 4.0 SP5, One World 7332, SP11.3, SQL 7.0 SP2, MDAC 2.5
 
Does the field have blanks as leading characters. If it does trim blanks from
the left and right of the field. Also try substringing into a variable not into
the FC field.

Ken Stern
OneWorld Developer
Andrews Consulting Group
700 West Johnson Ave
Cheshire, CT. 06410
 
Kenneth,

Try the:
FC Tax Rate/Area = substr(ltrim([FC Tax Rate/Area])," "),0,5 )
combination.
I have experienced that on some SP level the Expression Manager removes the qutation marks from the expression and so it does not work properly.
You can try on your site:
1.) Enter the expression as you see above.
2.) OK the expression.
3.) Re-open the expression.
If you see the qutation marks then everything is OK.
If you don't then:
1.) Create a variable based on a character Data Item e.g.:
evt_BlankChar_EV01
2.) Extend your ER and modify the expression:
evt_BlankChar_EV01 = " "
FC Tax Rate/Area = substr(ltrim([FC Tax Rate/Area]),evt_BlankChar_EV01),0,5 )

Hopefully, it will work. Please, let us know it.

Regards,
Zoltán


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
First try trimming it, using LTRIM() and RTRIM(). Trim space " ". Some times
space gives problems.

Prads.
 
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Has anyone used SUBSTR succesfully in ER. I am trying to substring out the
first 5 characters of Tax Rate/Area in program P4210 and I CANNOT get it to
pick up the first character. I have tried the following statements and
neither work.

FC Tax Rate/Area = substr([FC Tax Rate/Area],0,5 )

and

FC Tax Rate/Area = substr([FC Tax Rate/Area],1,5 )


Any help would be appreaciated. Thanks.


______________________
Kenneth Elder
Lead Analyst
Hartmann, Inc.
Phone: (615)453-3220
Fax: (615)443-4619

NT 4.0 SP5, One World 7332, SP11.3, SQL 7.0 SP2, MDAC 2.5




--------------------------
 
I've substringed.

Using the offset of 0 should have worked.

Your example shows reads as both source/target
being the same field. Have you tried using a diff field
as the target?



Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
 
Gene,

Great observation that the left and right operands are the same.
In the ancient time I have had bad experiences with the same situations (string manipulations) under B7321 SP(?).
Since I always use different operands on the left and right side when I use string functions (to be on the safe side), so I do not know that does this problem still exist in the later SPs and OW levels.

Zoltán

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Your first example is correct.
Try using Interactive Debug to verify the value of FC Tax Rate/Area
at the point where you are doing the assignment.

Joseph Sadler,
World Vision Canada.
Helping the children of war and poverty, the world over.
Xe SP13, NT4 SQL 7, AS/400.



Kenneth_Elder28
<Kenneth_Elder@Har To: [email protected]
tmann.com> cc:
Sent by: Subject: Substring
owner-jdeowdevml@j
delist.com


05/18/01 12:23 PM
Please respond to
jdeowdev






Has anyone used SUBSTR succesfully in ER. I am trying to substring out the
first 5 characters of Tax Rate/Area in program P4210 and I CANNOT get it to
pick up the first character. I have tried the following statements and
neither work.

FC Tax Rate/Area = substr([FC Tax Rate/Area],0,5 )

and

FC Tax Rate/Area = substr([FC Tax Rate/Area],1,5 )


Any help would be appreaciated. Thanks.


______________________
Kenneth Elder
Lead Analyst
Hartmann, Inc.
Phone: (615)453-3220
Fax: (615)443-4619

NT 4.0 SP5, One World 7332, SP11.3, SQL 7.0 SP2, MDAC 2.5




--------------------------
 

Similar threads

Replies
0
Views
1K
Kenneth_Elder
Replies
0
Views
1K
Kenneth_Elder
Replies
8
Views
4K
Zoltan_Gyimesi
Zoltan_Gyimesi
Back
Top