ACC: Sorting/Grouping a Query Using a Portion of Field's ValueLast reviewed: April 2, 1997Article ID: Q88927 |
The information in this article applies to:
SUMMARYNovice: Requires knowledge of the user interface on single-user computers. You can sort or group a query by using only a portion of a field's value. For example, in the Northwind sample database, you can create a query based on the Employees table that uses the Mid() function to sort by six characters beginning with the fourth character in the LastName field. You can use the Left() and Right() functions to return the first and last characters of a string argument. NOTE: In Microsoft Access versions 1.x and 2.0, there is a space in the Last Name field.
MORE INFORMATIONThe following procedure explains how to use the Mid() function to sort data by using only a portion of a field's value:
PartNo ------------------------ A-453-34567 A-123-45675 B-234-75658 B-645-65759 and so forthTo sort these part numbers by the third through fifth characters only, use the following expression:
Expr:MID([PartNo]),3,3) REFERENCESFor more information about string functions and related functions, search the Help Index for "String function," "Left function," "Right function," and "Len function." |
Keywords : kbusage QryOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |