I need to get what is between the "-" and the "x" 12.450X5.65-13.476x12.89
12.450X5.65-13.476x12.89
I need the 13.476 out of the above string
the data look like this
23.5625X11.375-11.125x19.5625
5.625X17.25-2.875x14.5
23.75X17.25-12.5x19
Re: I need to get what is between the "-" and the "x" 12.450X5.65-13.476x12.89
This is what I have I just can't get it to come out right
<code>
If instr(Trim({Flat_panel1.jmaPartShortDescription}), "-") <> 0 THEN
If instr(Trim({Flat_panel1.jmaPartShortDescription}), "x") <> 0 Then
startPos1 = instr(Trim({Flat_panel1.jmaPartShortDescription}), "x") - 1
Stileandrail = right(Trim({Flat_panel1.jmaPartShortDescription}),startPos1)
Else
Stileandrail = Trim({Flat_panel1.jmaPartShortDescription})
End IF
xposition = instr(Stileandrail, "x")
startpos2 = len(Stileandrail) - xposition
formula = Right(Stileandrail,startpos2)
</code>
Re: I need to get what is between the "-" and the "x" 12.450X5.65-13.476x12.89
I'm not a crystal expert, but why not use mid() to extract the required info. Something along these lines (not tested and not complete)
Code:
str1 = instr({Flat_panel1.jmaPartShortDescription}, "-")
str2 = instr({Flat_panel1.jmaPartShortDescription}, "x")
if str1<> 0 then
if str2 <> 0 then
number = trim(mid({Flat_panel1.jmaPartShortDescription}, str1 + 1, str2 - str1 - 1))
else
number = trim(mid({Flat_panel1.jmaPartShortDescription}, str1 + 1))
....