Re: Criteria

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 03/14/05


Date: Mon, 14 Mar 2005 11:37:25 -0700

On Mon, 14 Mar 2005 07:51:04 -0800, "idontgetit"
<idontgetit@discussions.microsoft.com> wrote:

>Is it possible to choose more than one value in the same field using the
>"AND" criteria. For example: I have a listing of store #'s in one field and
>a map of that store number in another field. I want to type store # 5.6.7.8
>and 9 and have the query pull all 5 of those stores. What do I type as the
>criteria?
>Thank you VERY much!

AND and OR are *NOT* English language conjuctions: they are Boolean
logical operators. X AND Y is TRUE if both X and Y are TRUE
expressions; if either is FALSE then X AND Y evaluates to FALSE.

A query criterion is a logical expression; if it evaluates to TRUE
then the record is retrieved, and if it's FALSE the record is skipped.

So if you have [Store Number] = 5 AND [Store Number] = 6 you will
never retrieve any stores, because for any individual record, the
store number cannot possibly be equal to 5 and also equal to 6!

Two suggestions: you can use OR criteria (i.e. retrieve this record if
the store number is 5, OR the store number is 6); or you can use the
IN() operator. Put

IN (5, 6, 7, 8)

on the criteria line and it will (again using OR logic) return records
for any of the selected values.

                  John W. Vinson[MVP]



Relevant Pages

  • Re: Criteria
    ... When I type in "In ([Store #?])" in the criteria, it will ask me for the ... > A query criterion is a logical expression; ... > never retrieve any stores, because for any individual record, the ...
    (microsoft.public.access.queries)
  • Re: Date query
    ... If you only store the date part and only want to return records where the DueDate is the current date, set the criteria under DueDate to: ... 2010 and I want to retrieve everything from ...
    (microsoft.public.access.queries)
  • Re: Newbie help
    ... think I can probably get what I need using SQL Server (the ... > To efficiently store and retrieve data for your needs, ... You only store changed values (as ...
    (microsoft.public.sqlserver.programming)
  • Re: DOCX FILE CORRUPTED WHEN RETRIEVED FROM SQL2005
    ... I am facing the same problem and would appreciate your reply on the same as it has become a show stopper for me now. ... My Code is given below to retrieve the docx content from SQL 2005 whose data type is image. ... Here is the code where i insert the file into database. ... when I store these files to the server, using the code below and similar ...
    (microsoft.public.office.developer.vba)
  • Re: Simulink store/retrieve values during simulation
    ... Is there really no way that you can store and retrieve data values during a simulink simulation like you can do with a written loop in an standard m-file? ... or in the signal processing blockset look at the buffer or delay line blocks. ...
    (comp.soft-sys.matlab)