473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

'Like' statement with a variable

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
Mar 16 '07 #1
4 1023
abnewallo wrote:
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öran Andersson
_____
http://www.guffa.com
Mar 16 '07 #2
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öran Andersson" wrote:
abnewallo wrote:
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öran Andersson
_____
http://www.guffa.com
Mar 16 '07 #3
On Mar 16, 1:58 pm, abnewallo <abnewa...@discussions.microsoft.com>
wrote:
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öran Andersson" wrote:
abnewallo wrote:
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öran Andersson
_____
http://www.guffa.com- Hide quoted text -

- Show quoted text -
try

Where Title Like @titl + '%'

Mar 16 '07 #4
Thanks. It worked.

"Alexey Smirnov" wrote:
On Mar 16, 1:58 pm, abnewallo <abnewa...@discussions.microsoft.com>
wrote:
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öran Andersson" wrote:
abnewallo wrote:
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öran Andersson
_____
>http://www.guffa.com- Hide quoted text -
- Show quoted text -

try

Where Title Like @titl + '%'

Mar 16 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
11
by: brainsucker | last post by:
Hi My name is Juan Carlos Rodrigo, and I love Python. It is the most impressive and usefull language that I have ever seen. I am studing, at http://www.uoc.edu, an Information Technology...
4
by: Tom Walker | last post by:
I cannot get the WHERE statement to work correctly unless I use a literal with the LIKE. I want to use a working storage data name so that I can vary the WHERE statement. Example that works: ...
4
by: Polly | last post by:
I had a macro that ran a parameter query and created and opened an Excel file with the system date as part of the file name, but I had to change the file name by hand. So I converted the macro to...
7
by: Sunny | last post by:
Hi, I can not understend completely the lock statement. Actally what is locked: 1. the part of the code between {...} or 2. the object in lock() In the docs is written: for 1: The lock...
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
33
by: =?Utf-8?B?RE9UTkVUR1VZ?= | last post by:
Hello, In vb.net there is a with statement, Is there are similar constructor in c#?
5
by: simudream | last post by:
//hi maybe helpful others can look at this code and //tell me why the class code won't behave like //intrinsic types with post and pre increment //Version: 1.00 #include <iostream> using...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.