• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Unleashing the Power of Queries > Understanding Grouping and Sorting

Understanding Grouping and Sorting

The Group By clause in Access queries provides a quick and easy way to run aggregate calculations, such as totals, on groups of like values. The DSUM function in Excel is the counterpart to a Sum calculated with the Group By clause in an Access query. However, this function is cumbersome when compared to ease of running its counterpart in Access. You could sort and subtotal in Excel, but again, the Access method is more streamlined.

In Table 4.3, notice that there are two losses for both Florida and Colorado. Because the AccidentState field has the like values and the Incurred field has the values you want to add for a total, place the Group By clause in the AccidentState field and the Sum aggregate calculation in the Incurred field. You do not want to group the Incurred field because there are no like values in this example. And you do not want to try to sum a field with text values, such as AccidentState.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint