'Like' statement with a variable

G

Guest

I am in the Query Builder component of Visual Web Developer Express Edition
and wish to use a variable in the 'Like' part of an SQL statement
 
G

Guest

abnewallo said:
I am in the Query Builder component of Visual Web Developer Express Edition
and wish to use a variable in the 'Like' part of an SQL statement

Yes, and the problem is?
 
G

Guest

Could someone help me with the syntax of the 'Like' portion of the statement?

For example I am using the following

Where Title Like @titl & '%'

and I am getting an error message the following error message

The data types nvarchar and varchar are incompatible in the booleand AND
operator.

I have also tried several combinations of the double quotes as well but so
far have been unsuccessful
 
G

Guest

Could someone help me with the syntax of the 'Like' portion of the statement?

For example I am using the following

Where Title Like @titl & '%'

and I am getting an error message the following error message

The data types nvarchar and varchar are incompatible in the booleand AND
operator.

I have also tried several combinations of the double quotes as well but so
far have been unsuccessful





- Show quoted text -

try

Where Title Like @titl + '%'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top