I'm trying to filter rows in a v11.2.3 report to include content based upon just the first character of a string. However, I know that my data can include any numeric or character value; and, I'm really only interested in filtering to include a single alpha character followed by a dash and then the rest of the string is irrelevant.
I've tried this...
[Study Error Message] like '_-%'
...but I get rows that include values like "1-" and "2-" as well as "A-" and "B-".
Is there a different wildcard I can use instead of an underscore to exclude the numeric values?
Thank you kindly.
For the field to have numeric as well as alphabets, the data type has to be char/varchar/string.
Even in a character data type, 1 till 9 is considered lower than A so try:
[Study Error Message] >= 'A-'
If that doesn't work then try:
substring([Study Error Message],1,1) not in ('1','2','3','4','5','6','7','8','9') and
substring([Study Error Message],2,1) = '-'
What RDBMS?
For SQL Server:
[Study Error Message] like '[a-zA-Z]-%'
For MySQL (and maybe Oracle):
REGEX_LIKE([Study Error Message], "^[a-zA-Z]-.*")