need to count more than one instance of a letter in 1000's of 'hyphened' strings

Database
Enthusiast

need to count more than one instance of a letter in 1000's of 'hyphened' strings

This is my data and I need to prove that the letter 'T' occurs more than once in the following field Type_of_Account: (there are 1000's of accounts) and i either want to put this in the Where clause, such as (Where 'T' occurs >Once). I dont want a return where T occurs only once (like Row number 3).

 

Type_of_Account:

T-T-V-V
T-T-V

T-V
T-T-T-V
T-T-T-T-T-T-T


Accepted Solutions
Junior Supporter

Re: need to count more than one instance of a letter in 1000's of 'hyphened' strings

This should work

 

where character_length(Type_of_Account)- character_length(oreplace(Type_of_Account, 'T', '')) > 1

1 ACCEPTED SOLUTION
3 REPLIES
Junior Supporter

Re: need to count more than one instance of a letter in 1000's of 'hyphened' strings

This should work

 

where character_length(Type_of_Account)- character_length(oreplace(Type_of_Account, 'T', '')) > 1

Supporter

Re: need to count more than one instance of a letter in 1000's of 'hyphened' strings

where Type_of_Account not like '%T%T%'

Enthusiast

Re: need to count more than one instance of a letter in 1000's of 'hyphened' strings

thanks so much