You are here:About>Computing & Technology>Databases
About.comDatabases

"MODIFYING A QUERY" > Page 1, 2, 3

V. Sorting the Results

The human mind prefers to work with data presented in an organized fashion.  For this reason, we often desire to sort the results of our queries based upon one or more of the fields in the query.  In our example, we want to sort the results alphabetically based upon the product's name.

1.  Click the Sort entry for the appropriate field.  Single click in the Sort area of the field entry and a black down arrow will appear.  Single click on this arrow and you'll be presented with a list of sort order choices.  Do this for the Products.ProductName field in our example.

2.  Choose the sort order.  For text fields, ascending order will sort alphabetically and descending order will sort by reverse alphabetic order.  We want to choose ascending order for this example.

That's it!  Close the design view by clicking the "X" icon in the upper right corner.  From the database menu, double click on our query name and you'll be presented with the results shown below -- exactly what our purchasing department asked for!

Check back with us next week for a look at creating a web interface for your database applications!  

Next page > > Page 1, 2, 3

Previous Articles

From Mike Chapple,
Your Guide to Databases.
FREE Newsletter. Sign Up Now!
Newsletters & RSSEmail to a friendSubmit to Digg
 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.