![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
LK Hi, I have a database that has a field with a character string and I need to search that string and remove part of it for use on something else, but here's the problem. The string looks like this most times, 03 136 17 .13), the part I need toremove and use is the percentage number, in this case it's .13. I select the field I want, put it in array, 'TEST' and extract the number like this ?substr('&TEST',12,3) and I get .13, convert is to numeric and I'm off to go. Now here's the problem, about 30% of the time the character string can look like this, 03 1 17 .10), or this 03 10 20 .50) and I try to extract it usingthe same function, 'substr' but I get only part of it or none of it because it's position has changed. Now 99.99% of the time the percentage is always to 2 digits and a decimal point, '.01' in some rare case it's, '1.00' but I'm not worried about that. Now in the database field the character strings always starts all the way over at the left hand side of the field, if it started at the right hand side it would be easier I may be able to use right() to get my characters, but it doesn't. Any ideas on how I can do what I need to do? Thanks |
#3
| |||
| |||
|
|
On 09 May 2004 00:53:48 GMT, lawyerkill (AT) aol (DOT) com (LawyerKill) wrote: TEST = 03 1 17 .10)? StrTran(substr(TEST, at('.', TEST)), ')') I assume if the result is '.00', that will actually mean '1.00' and you can just test for that. |
![]() |
| Thread Tools | |
| Display Modes | |
| |