Is it possible to include in a SQL statement the requirement for position 5, or the last character in a column, to be an alpha character rather than a number?
Yes both of those are possibilities to put in the where clause. You said or so I assume you meant either condition must be true so I used OR to combine the statments. If you want BOTH to be true then you could use AND.
Code:
Select fieldname, fieldname2
From [Table Name]
Where asc(right(fieldname,1)) between 65 and 122 OR
asc(mid(fieldname),5,1) between 65 and 122
Although, I would use the like operator...
Code:
Select fieldname, fieldname2
From [Table Name]
Where fieldname Like "????[A-Z]*" OR fieldname Like "*[A-Z]"
In my example the statement can be changed if both are true so you don't have to use AND.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.