Check if character exists in string

L

Lars Brownies

I want to check if a string contains any of the following characters:
\/:*?"<>|#
What's the easiest way to do this?

Thanks,

Lars
 
J

John W. Vinson

I want to check if a string contains any of the following characters:
\/:*?"<>|#
What's the easiest way to do this?

Thanks,

Lars

A LIKE query:

If string LIKE "[\/:*?"<>|#]" Then
 
L

Lars Brownies

Thanks John! Works like a charm.

I had to add 2 asteriks and an extra ".
If str Like "*[\/:*?""<>|#]*" Then

Lars

John W. Vinson said:
I want to check if a string contains any of the following characters:
\/:*?"<>|#
What's the easiest way to do this?

Thanks,

Lars

A LIKE query:

If string LIKE "[\/:*?"<>|#]" Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Special characters 3
Checking for special characters 6
UNION and INTO 2
locating character position in a text string 3
Help with a query 2
Help Sorting OID Strings 4
Check for MSysCompactErrors 4
Check time value 3

Top