VB.net SQL - Select items using LIKE

Hi

I am trying to select any records in a table where the column Food_Desciption
contains the word "APPLE" but there is something wrong with my syntax below

Select * From Food Where [Food_Description] LIKE '*APPLE*' OR [Food_Description] LIKE '*APPLE*'

Ay the end of it I want the user to be able to enter any letter combination
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
Use percent symbols:

Select * From Food Where [Food_Description] LIKE '%APPLE%'

Open in new window


Stars work in Access. SQL Server uses percent symbols.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks. The system of mine that i copiedm that from caters for Access and SQL. Copied the wrong part of the if statement. Thanka for pointing out my silly mistake
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.