Help with searching for a substring

G

Guest

Hello

Hope someone can help me

I am having a problem writing an sql query to limit the number of entries returned by searching for a substring. I know one can use LIKE '% %' to find a certain string in a field. The problem is that the string I need to search for is from another column in the table. For example I get the number in the GATE column than I need to check weather that number as a substring appears in the curGate table. If it does return the line if not don't.
 
J

John Vinson

Hello

Hope someone can help me.

I am having a problem writing an sql query to limit the number of entries returned by searching for a substring. I know one can use LIKE '% %' to find a certain string in a field. The problem is that the string I need to search for is from another column in the table. For example I get the number in the GATE column than I need to check weather that number as a substring appears in the curGate table. If it does return the line if not don't.

In SQL/Server or MSDE, you can use

LIKE "%" & [Gate] & "%"

In Access JET databases, the wildcard character is * rather than %.
 
M

[MVP] S.Clark

Please restate with a few more exact example. You're close, though.

p.s. weather is rain, snow, etc. Use whether for readability.

Jonathan said:
Hello

Hope someone can help me.

I am having a problem writing an sql query to limit the number of entries
returned by searching for a substring. I know one can use LIKE '% %' to find
a certain string in a field. The problem is that the string I need to search
for is from another column in the table. For example I get the number in the
GATE column than I need to check weather that number as a substring appears
in the curGate table. If it does return the line if not don't.
 

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

Top