
HELP / HELP / syntax SQL / 'LIKE' clause
I have read all of the answers to your question and would like to say that I
agree with the responses. I would just like to point out the minor
differences and why there are differences.
There were two basic answers:
1. Qry = "SELECT * FROM table1 WHERE field1 LIKE 'ABC%' "
2. Qry = "SELECT * FROM table1 WHERE field1 LIKE 'ABC*' "
For those of you that have not run into this situation, ACCESS uses the (*)
star symbol for the wild card; however, SQL Server uses the (%) percent sign
for the wild card.
It can be a problem when trying to "scale up" from ACCESS to SQL Server.
Have a nice day!
Rob
Quote:
>Could anybody kindly tell me the proper format for the following:
>Qry = "SELECT * FROM table1 WHERE field1 LIKE "ABC%""
>I do not understand how the specify the LIKE expression "ABC%" within
>the Qry assignment statement. SQL syntax says ABC% must be in quotes
>the statement above chokes when it finds the first " in front of ABC%
>What combination of characters must I use to make this LIKE expression
>work?
>Thanks so much for any help, Greg Hedberg