Microsoft KB Archive/92689

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

ACC1x: Queries Sort by Order of IN() Parameters

Q92689



The information in this article applies to:


  • Microsoft Access versions 1.0, 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

  1. 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
Issue type : kbinfo
Technology :


Last Reviewed: November 4, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.