I am trying to write a query that is dealing with alphanumeric and I am stuck. I have a table that has a client#, Date of service, CPT_Code and amount. The CPT_Code can contain numeric and alphanumeric. What I trying to do is define the code using a case when statement.
Example
Case when CPT_Code between '1' and '9' then 'Payment'
when CPT_Code between '20' and '39' then 'Debit'
The issue I have is the CPT_Code that begins with 2 and has an Alpha at the end needs to be 'Debit'
Can't use like '2%' cause 200 will be defined as 'Charged'
In short is there anyway to query and look for anything that begins with 2 and has an alpha and the end.
Thanks in advance for the help.
If this is confusing, I am sorry. I haven't had enough caffeine yet.
Example
Case when CPT_Code between '1' and '9' then 'Payment'
when CPT_Code between '20' and '39' then 'Debit'
The issue I have is the CPT_Code that begins with 2 and has an Alpha at the end needs to be 'Debit'
Can't use like '2%' cause 200 will be defined as 'Charged'
In short is there anyway to query and look for anything that begins with 2 and has an alpha and the end.
Thanks in advance for the help.
If this is confusing, I am sorry. I haven't had enough caffeine yet.