-
access 2k2 query problem
hi,
i am currently using MS access 2002 and i have a problem regarding the following table...
*Name *Item Number
--------------------------------------------
john ball
john watch
john computer
john telephone
*Primary key
The whole of number column is empty, and the primary key is Name and Item.
i wanted to select all the rows except for, say, the first row...
i use the following query string:
SELECT * FROM table1 WHERE Name<>'john' AND Item<>'ball';
the result return nothing, why is that so??
thz in advance
Last edited by 0133892; 08-01-2003 at 01:28 AM.
-
That's because Name<>'john' condition eliminates all rows.
Try
SELECT * FROM table1 WHERE Name<>'john' OR Item<>'ball';
-
i tried that before and it fail...
using the OR operator would mean that EITHER one of the condition is true will return the row.. and name<>'john' would result in all row being false, and nothing gets return...
basically, using the AND operator should work, as it require two condition to be true...even if one is true, the row will not be return...
actually i was wondering if access 2k2 have any setting or option that actually can cause this kind of error?
-
Try this
SELECT * FROM table1 WHERE Name+Item <>
'john' +'ball';
-
using the OR operator would mean that EITHER one of the condition is true will return the row.
Exactly.
But only one row, but last three rows will evaluate Item<>'ball' to TRUE and you get 3 rows.
-
erm... i think i got what u trying to say... hmm... i will give it a try... thz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|