Re: No success with setting query criteria for returning empty



If there is nothing at all in the Status field for active students, the
value will be Null

In the Criteria row under this field in query design, enter:
Is Null

Nulls behave differently than other types of data. A null really means
'Unknown', or 'Not applicable'. Strictly, it is not the right thing to store
where the student's status is known. It would make more sense to use an
Update query to change all the nulls into another code such as "C" for
Current students. (If it's somebody else's application, that might break the
way they set up the rest of the application though.)

If you are interesting in learning about how to handle Nulls, see:
Common errors with Null
at:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"RC" <RC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:05EBA8C3-D362-4C53-BC62-07E64A81FDD2@xxxxxxxxxxxxxxxx
>I have imported tables from another database into Access and one of these
> tables has a field that stores a value that denotes the status for each
> student enrolled in a school. The values appear as "N" for students "Not
> Returning" for a new school term, "I" for students withdrawing during the
> term and are "Inactive" for the remainder of the term, and what appears to
> be
> as "blanks" or "empty" for "active" students. Using a query on that table.
> I'm trying to set the criteria for the Status field so that it will return
> only "active" students, but having no success with trying conditions such
> as
> Not Like "N" And Not Like "I", or <> "I" And <> "N", or Like " ", or = "
> ".
> Each of these appear to return no data at all.
> The query runs fine when setting the criteria of the Status field as
> either
> Like "N" to return only the students "Not Returning", Like "I" to return
> only students withdrawing during the term, or Like "I" or Like "N" to
> return
> all the student who are not active. It's only when setting the criteria so
> that only "active" students are returned by the query that does not seem
> to
> work.
> I'm wondering if the Status field of the imported table could have some
> hidden value for the "active" students, and Access can "see" this value.
> The
> Status field appears as being "blank" or empty for "active" students in
> its
> original database as well. All help will be greatly appreciated.
> Thanks in advance,
> RC


.



Relevant Pages

  • RE: Query with Criteria Not Working
    ... Why is the criteria under the count? ... FROM tblClasses INNER JOIN tblLink ON tblClasses.ClassNo = tblLink.ClassNo ... The problem occurs whenever I add a criteria, that's when the query fails to ... I'm trying to build a query that counts the number of students who ...
    (microsoft.public.access.queries)
  • Re: implimenting select...Case
    ... > 1) Have a combo/option group/whatever control that allows the user to pick ... > 3) The query that you use is then decided by a straight select case ... 'find all the students in a building ... >>> Its going to get worse cos ive been told that further criteria will be ...
    (microsoft.public.access.formscoding)
  • Re: monthly query
    ... I have a group of students who can take a selection of 18 different modules. ... So the criteria changes each month. ... I can run the query & revise it each month, but i have to do it all ... You can use Access' builtin date/time functions to create a dynamic criterion. ...
    (microsoft.public.access.forms)
  • RE: Null or No Null values in a parameter query
    ... IIf([Press ENTER for nulls, 'N" not nulls] Is Null,1,0) test if ... All criteria on the same line must be met -- they are AND'd together. ... I can see that a field called 1 was added to my query with a ... "KARL DEWEY" wrote: ...
    (microsoft.public.access.gettingstarted)
  • RE: Query with Criteria Not Working
    ... "Robert T" wrote: ... The problem occurs whenever I add a criteria, that's when the query fails to ... I'm trying to build a query that counts the number of students who ...
    (microsoft.public.access.queries)