Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the LIKE keyword in a SQL query

Does anyone have an example using the Database Connectivity Execute Query vi and the LIKE keyword? I would like to do something like:

SELECT TestNum, TestType FROM tests WHERE DeviceType ='Paul_AF125_Ver1' AND DeviceID = 'Test1' AND (TestType LIKE "Cyclic Voltammetry*")

It works fine if I say LIKE "Cyclic Voltammetry" (without the *) but if I put the * in there, I get no records.
I'm using Microsofts SQL Server Desktop Engine (comes with Access).

Thanks,
Paul
0 Kudos
Message 1 of 2
(2,718 Views)
Paul-

Thank you for contacting National Instruments. I don't have an example program, but I did find some information for you.

LIKE - similar to.

Using the LIKE command, you can use the wildcard symbol %. To find names starting with J : names LIKE 'J%'; Ending in s ? name LIKE '%S'; You can use more than one % charactor too : names LIKE '%sam%'; Also, LIKE is not case sensitive.

What you have written, may work if you change the wildcard syntax from * to %.

-Erik
0 Kudos
Message 2 of 2
(2,718 Views)