'Like' statement with a variable

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
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
 
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 + '%'
 
Back
Top