Link to home
Start Free TrialLog in
Avatar of carpetflyer
carpetflyer

asked on

Sql Statement: Text Does not contain numbers or symbols

Hello everyone.

I am really rusty with SQL statements so I was wondering, what SELECT statement would be ideal for filtering out a Text field that contains numbers or symbols ie []{}(), etc....

SELECT * FROM table WHERE txtField.......

Thanks.
SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How about using Eval()?

M
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of carpetflyer
carpetflyer

ASKER

Thanks for the responses everyone.

So shanesuebsahakarn, Can you put reg expressions in sql statements? What you gave me looks like it. So i can do: MyField Like "[a-zA-Z]" meaning MyField will grab records that contain one letter ie a or b or c, etc etc??

Thanks.
SELECT FieldName
FROM TableName
WHERE (((FieldName) Like "[****]"));

This will grab all the letter inside....

Carpetflyer yep, you can certainly use your example, but Like doesn't support very powerful regular expressions. Note - you don't need both a-z and A-Z - Like is not case sensitive, so a-z will match both A and a.
>>but Like doesn't support very powerful regular expressions

So what does support reg exp in SQL? Just curious thats all.

Thanks again.
You can use the VB script regular expression library (by adding the library into references):
http://authors.aspalliance.com/brettb/VBScriptRegularExpressions.asp

but you'll have to write some code to perform the comparison.
Wow, interesting...i'll keep this in mind.

Thanks for the link.

Thank you again everyone! :)