Extract numbers from one field to display in another field
AnsweredHello,
I currently have a field (named 'Credit') in a view that contains both text and numbers (example: 'CPE,6').
My goal is to copy the numbers from the first field and display them in another field.
So, the other field (Field Name: 'Credit Hours') would display only the '6', but not the 'CPE,'
What is the best way to accomplish this without having to revise the view?
-
The message would typically let you know which function is undefined, by stating the line and column in which there was an error. That could help you find where the syntax error is.
Anyways, I can see I was missing a comma and also the string parameter in the SQL code I suggested...
Try this:
TOINT(RIGHT(Credit,LENGTH(Credit)-indexof(Credit,',',1)))
-
Thanks to you both - it was actually a combination of your responses that ended up resolving the dilemma; I ended up using the following (please suggest a cleaner solution if you have one):
TOFLOAT (StrParts([Credit],' ',5))
this extracts just the number from the column and converts to FLOAT, now allowing the SUM of the numbers.
Thanks!
Please sign in to leave a comment.
Comments
8 comments