Search for entries with a given field length?

Post Reply
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

Search for entries with a given field length?

Post by jkj2001 »

Hi,

We have a field in one of our tables that's either 10,11 or 12 characters long. We'd like to find those records where that value is exactly eleven characters, and unfortunately, we can't use the "length" function to do this on our web interface. Is there a way to pull it off with a rex expression, possibly using alnum?

For instance, our final query would look something like this:

select * from mytable where myfield like '/alnum{11,11}'


Thanks.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Search for entries with a given field length?

Post by mark »

Exactly 11 of any character, anchored to field begin and end.
like '/>>=.{11}>>='
or
matches '???????????'
or (depending on your matchmode setting)
matches '___________'
Post Reply