ACC1x: Queries Sort by Order of IN() Parameters

Last reviewed: April 2, 1997
Article ID: Q92689
The information in this article applies to:
  • Microsoft Access versions 1.0 and 1.1

SUMMARY

If you use the IN() operator in an unsorted query, the output will be grouped on the associated field. In addition, Microsoft Access will place the groups in the same order as the parameters are listed in the IN() operator.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a table with Firstname and Lastname fields (data type "text"). Enter the data listed below:

          JOE    SMITH
          JANE   DOE
          ABE    LINCOLN
          JOHN   DOE
    
    

  2. Create a query on this table. In the Criteria cell for Lastname, type:

          IN("LINCOLN","DOE")
    

    The query will generate these records:

          ABE    LINCOLN
          JANE   DOE
          JOHN   DOE
    
    
You can have the records appear in a different sequence by changing the order of the parameters in the IN() operator, or you can explicitly specify a SORT order.


Additional query words: sorting group in order by
Keywords : kbusage QryOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.