Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

VB.net SQL Instr Function

Hi

I am trying to run the following query against a SQL database in my VB.net app but am getting an error that
the Instr function is not recognized

Select Distinct [CustomerID] From [CHILDREN] Where Instr([Child Name],'Jayden') > 0
Visual Basic.NETMicrosoft SQL Server

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon
Russell Fox

SQL uses CHARINDEX:
Select Distinct [CustomerID] From [CHILDREN] Where CHARINDEX('Jayden', [Child Name]) > 0

Open in new window

ASKER CERTIFIED SOLUTION
Russell Fox

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Murray Brown

ASKER
Thanks very much
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck