Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.net SQL - Select items using LIKE

Posted on 2013-12-28
2
Medium Priority
?
976 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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:Murray Brown
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

721 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