• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1067
  • Last Modified:

Determine if 5th char in string is Alpha

I need to add to my where clause a condition if a certain string's 5th char, within the string is alpha - so

12345 - OK
1234F - Not OK
0
tbaseflug
Asked:
tbaseflug
1 Solution
 
chapmandewCommented:
select * from table
where case when isnumeric(substring(fieldname, 5,1)) = 1 then 1 else 0 end = 1
0
 
tbaseflugAuthor Commented:
Perfect = thanks!
0
 
appariCommented:
isnumeric returns 1 for - also

select  isnumeric('-')

try some thing like this

Select * from
(Select '1234A' F1) as A
where F1 like '____[0-9]%'

select * from tableName where FieldName like '____[0-9]%'

where
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now