RowFilter help needed

C

chris.withers

Hi all,

I'm attempting to do something like the following SQL query:

SELECT * FROM `users` WHERE idusers != 3 | 2;

such as:

= "idusers <> 3OR 2";

But I get an error stating:

Cannot perform 'Or' operation on System.Int32 and System.Int32.

How can I use a range of values in such a statement as this? Any help
would be greatly appreciated.

Chris
 
K

Kevin Spencer

I'm afraid you're both wrong. Whereas your syntax is correct, the logic is
incorrect. Let me explain:
"idusers<> 3 OR idUsers <>2"

Let's say that idusers = 1. The statement returns true.
How about 2? The statement returns true because it is not equal to 3.
So, what about 3? The statement returns true because it is not equal to 2.

In other words, this filter is not a filter at all. It will return true for
all records.

Unfortunately, I can't tell what the actual condition is supposed to be, or
I would give the syntax for it.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 
S

Swanand Mokashi

Yeah I thought of that -- but just replied with the filter syntax --
probably should have mentioned ;-)


--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
 
C

chris.withers

Swanand said:
Yeah I thought of that -- but just replied with the filter syntax --
probably should have mentioned ;-)


--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services


What i'm trying to do is show every record which doesn't match a
certain id. Ideally I want to manipulate the string holding the command
so Id's can be added based upon user selections.

Thanks,

Chris
 
K

Kevin Spencer

What i'm trying to do is show every record which doesn't match a
certain id. Ideally I want to manipulate the string holding the command
so Id's can be added based upon user selections.

In that case, you would use AND rather than OR.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top