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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to separate numbers and text?

Status
Not open for further replies.

psbrum01

Technical User
Oct 10, 2008
8
0
0
US
I have a field that should have been setup as numbers only but allowed numbers and text to be entered.

I am trying to write a report and sum the hours spent to do a test but the field has "2 hrs" or "0.5hrs.".

How can I pull out on the 2 or 0.5 so I can perform calculations on it?

Thanks
psbrum01
 
Tonumber() will work from the left and stop at the first alpha character.

Or try extractstring({field},'',h) if it is always lower case h as the first text entry.


'J


CR8.5 / CRXI - Discovering the impossible
 
Use:

val({table.field})

You can then insert a sum on this. This will capture any numbers that precede a alpha character in a field, so as long as the numbers always come first, this should work.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top