Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting information from a string 3

Status
Not open for further replies.

marckssg

Programmer
Nov 28, 2000
180
GB
Hi, I know I've done this in the past, but can't for the life of me remember how!

I have a field which contains information such as
"1234 ABCD"
if I want to split this field so that the "1234" appears alone how would I do it? The "1234" can very in length, but there is never a space in the numbers but always a space between the numbers and the text, the text also varys in length.

Cheers

Marc
 
Hi,
this formula should do the trick!!

numbervar n := tonumber(left({field},instr({field}," ")-1))


Geoff
 
Cheers Malc, not spotted that one before, a lot shorter

... as long as the second field does not have a number at the beginning!

Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top