Hi Jimmy,
If the stock number is a fixed length string then use SUBSTR(stocknumber, startposn, numchars)
If it is not fixed length then you need to establish the length of the number (assuming that there is a hyphen in the stock number as per your example)
lnStartPos = 3 && the number begins after "BR"
lcNum = Substr(StockNumber, lnStartPos, AT("-", StockNumber)-lnStartPos)
You will need to convert to a numeric type using VAL before you can use it for calculations.
HTH
Liam
>I have a stocknumber for each product similar to BR(number)-stuff. I need to extract (number) from the stocknumber shown in a drop down for use in a mathematical expression with a value in another. What expression should I use to do the extraction?
>
>Thanks,
>JD
Liam O'Hagan
MCP VFP Desktop Apps