RE: Query returns no rows when <> 0 applied
- From: Leo <Leo@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Aug 2007 09:04:01 -0700
Duane, you are a star. Your question provided the solution.
If I Updated the field with a "" (double quote) it got rid of the Null flag
and I get the records. So it had to do with the Null value.
I do not think I have ever encountered this before in the long list of
Access solutions I have built. I do understand the behaviour now, as I was
asking the query for anything that's different from 0, but there was nothing
available as all other rows were Null, so it did the right thing, but is this
the case with an Access 97 or 2000 database as well? I am little confused!
--
Leo
"Duane Hookom" wrote:
Is the field possibly Null?.
--
Duane Hookom
Microsoft Access MVP
"Leo" wrote:
Actually, this is not working only on the 'Not', '<>', 'Not Like' statements
- so statements that exclude specific or a range of data are not working, the
query comes back empty. I also tried to build it through code, but I am
getting the same results.
--
Leo
"Leo" wrote:
Hi Jerry. Thanks for the reply. Not at all, this table is in Access. It's an
.mdb file, so nothing special about the database. I tried it on another
machine, with Access 2003 installed, but got the same result. I tried
importing the table in a fresh database, but I am getting the same result!
--
Leo
"Jerry Whittle" wrote:
That is strange. Is this table in Access or something like SQL Server?
Will the following work?
Not 0
<0 Or >0
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
"Leo" wrote:
Here's my query:
SELECT TBL_RAW_IMPORT.EXCLUDE_FLAG
FROM TBL_RAW_IMPORT
WHERE (((TBL_RAW_IMPORT.EXCLUDE_FLAG)<>0));
EXCLUDE_FLAG is an Integer field
The thing is, I get no records returned at all, but this returns all the
records with 0s in it
SELECT TBL_RAW_IMPORT.EXCLUDE_FLAG
FROM TBL_RAW_IMPORT
WHERE (((TBL_RAW_IMPORT.EXCLUDE_FLAG)=0));
Another abnormal behaviour is using Not Like '*EXCLU*' for example on
another field. Not Like returns nothing, but using just Like returns the
appropriate records.
I am using Access 2003, and I have never encountered this behaviour before.
Has someone experienced this before? Can someone lead me to a possible
solution? Is it a setting in access I have to change? I am totally lost!!!!
--
Leo
- Follow-Ups:
- RE: Query returns no rows when <> 0 applied
- From: Duane Hookom
- RE: Query returns no rows when <> 0 applied
- References:
- RE: Query returns no rows when <> 0 applied
- From: Duane Hookom
- RE: Query returns no rows when <> 0 applied
- Prev by Date: Re: complex if statement
- Next by Date: Re: Access maybe, Sql no **WARNING: MALICIOUS SITE **
- Previous by thread: RE: Query returns no rows when <> 0 applied
- Next by thread: RE: Query returns no rows when <> 0 applied
- Index(es):
Relevant Pages
|