Solved

VB.net SQL - Select items using LIKE

Posted on 2013-12-28
2
824 Views
Last Modified: 2013-12-28
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
0
Comment
Question by:murbro
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39743908
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
 

Author Closing Comment

by:murbro
ID: 39743916
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

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question