0

I have searched forever and cannot find a solution that works. Most likely because of ignorance.

The database that I am querying is Interbase so the SQL syntax might be different than what I'm used to. When I add the following line to my SQL statement I get an error "Run time error: 1004" SQL Syntax Error.

"AND    p.DISPLAY_NAME LIKE %" & Worksheets("Page1").Range("H9").Value & "%"

Any help is greatly appreciated!

1
  • I think you are more likely to get help if you avoid expressions such as "I have searched forever". Commented Jun 28, 2013 at 18:49

1 Answer 1

2

I don't know about interbase but I suspect you need to surround the text-expression with apostrophes:

"AND    p.DISPLAY_NAME LIKE '%" & Worksheets("Page1").Range("H9").Value & "%'"

Remove the unnecessary spaces as well:

"AND p.DISPLAY_NAME LIKE '%" & Worksheets("Page1").Range("H9").Value & "%'"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.