TempVal: StripWhiteSpace(Link1.IncomingCol) * 100
Data type of IncomingCol is char.
If I do:
Left(TempVal, index(TempVal,'.',1)-1)
it gives me the error:
Numeric string expected for returned value from function call 'strip_whitespace'. Use default value.
However, if I do:
Left(Left(TempVal, index(TempVal,'.',1)), Len( Left(TempVal, index(TempVal,'.',1) ))-1)
it works eventhough I think it is a pretty lame way to solve this. It seems like eventhough the index function returns an integer, subtracting 1 from it causes the error. Can anyone tell me why I get the error in the first place?
Decimal/String manipulation problem
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 73
- Joined: Tue May 10, 2005 6:21 pm
- Location: Sydney
Re: Decimal/String manipulation problem
No idea
abc123 wrote:TempVal: StripWhiteSpace(Link1.IncomingCol) * 100
Last edited by Yuan_Edward on Wed Jul 18, 2007 5:46 pm, edited 4 times in total.
Edward Yuan
What error is returning? The inital error you posted makes sense, since you might be getting a conversion error on the implicit string-to-number conversion that is occurring when you try to multiply the string by 100.
The derivation copied above will probably generate an error when the 2nd argument is negative (i.e. when you have no "." in your string).
Code: Select all
Left(TempVal, index(TempVal,'.',1)-1)
The derivation copied above will probably generate an error when the 2nd argument is negative (i.e. when you have no "." in your string).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Your error is being generated on the maths line, not on the string manupulation one. What is the value of Link1.incomingCol (including spaces) that you are failing on?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 73
- Joined: Tue May 10, 2005 6:21 pm
- Location: Sydney
Re: Decimal/String manipulation problem
Did you use the same input data for both? I guess there must be non-numeric characters in IncomingCol.
By the way why not use the interal function FLOOR? I guess it does the same thing as your code "Left(TempVal, index(TempVal,'.',1)-1)"??
By the way why not use the interal function FLOOR? I guess it does the same thing as your code "Left(TempVal, index(TempVal,'.',1)-1)"??
abc123 wrote:TempVal: StripWhiteSpace(Link1.IncomingCol) * 100
Data type of IncomingCol is char.
If I do:
Left(TempVal, index(TempVal,'.',1)-1)
it gives me the error:
Numeric string expected for returned value from function call 'strip_whitespace'. Use default value.
However, if I do:
Left(Left(TempVal, index(TempVal,'.',1)), Len( Left(TempVal, index(TempVal,'.',1) ))-1)
it works eventhough I think it is a pretty lame way to solve this. It seems like eventhough the index function returns an integer, subtracting 1 from it causes the error. Can anyone tell me why I get the error in the first place?
Edward Yuan