Becky Edwards
asked on
How to truncate a string
This may sound simple to you, but not to me. I need to create a formula in Oracle Crystal that removes the first 4 characters in a field and leaves me with the rest of the field to show. Then I want to be able to use this new formula/field to evaluate the contents and provide a select statement from it.
Example: "ICD-401.01" This is the contents of the field. I need a new field with just 401.01 in it and then reference that field in a select statement that says {field} = [401.01, 401.02, 401.11, 456.24]
Example: "ICD-401.01" This is the contents of the field. I need a new field with just 401.01 in it and then reference that field in a select statement that says {field} = [401.01, 401.02, 401.11, 456.24]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi, do you need it in oracle or some other ?
ASKER
This worked perfectly. Thank you.
Turning ICD-401.01 into 401.01 is easy:
select substr('ICD-401.01',5) from dual;
I have no idea what you mean by:
reference that field in a select statement that says {field} = [401.01, 401.02, 401.11, 456.24]
Maybe:
select 'Found it' from dual where substr('ICD-401.01',5) in (401.01, 401.02, 401.11, 456.24);