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

Trying to convert a role into a number 1

Status
Not open for further replies.

mvalley

Technical User
Mar 4, 2011
80
US
I would like to convert a string field into a number

if({v_CRA_other_personnel.cr_other_personnel_role} = "2ND SCRUB")then convert this role to a number

Is this something that can be done, or am I trying to do the impossible?
 
you cannot convert text to anumber. you can assign a number based upon a value in a text field.
to build upon your formula:

IF ({v_CRA_other_personnel.cr_other_personnel_role} = "2ND SCRUB")then 2 else 0;

place this in your details section and it should display a 2 for each time the role is 2ND SCRUB and a 0 for all other roles

 
If the text field begins with a number, you could use:

val({table.string})

...but this won't work if the number is not the first character.

-LB
 
Thank you. Fisheromacse's suggestion worked, The text field does not begin with a number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top