I am trying to set a case statement to one of two values depending on the 4th character of a column. My SQL looks sort of like:
The problem that I am running into is that the user now tells me that it is the 4th 'Alpha' character = 'U' that is the switch. The string might start with 2 or 3 digits, then go into the Alpha string. Is there a way to tell it to look over any number of digits, then see if the fourth alpha character is 'U'? I am not sure if this can be done, but would be very grateful for any input.
Thanks in advance,
Doug [sig][/sig]
Code:
Select Field1,
Field2,
case when SUBSTR(TableName.ColumnName,4,1) = 'U' THEN 'Access'
when SUBST(TableName.ColumnName,4,1) <> 'U' THEN 'Non-Access'
end(named"Test")
From TableName
Thanks in advance,
Doug [sig][/sig]