Group By Clause in Microsoft Access Query

preview_player
Показать описание
In this tutorial, we will show you how to use a Group By clause in Microsoft Access.

Follow this step by step guide to group by clause in Microsoft access query and sort objects according to your personal liking. Groups in access can assist you in organizing the objects in your database. Group by Clause combines records with identical values in the specified field list into a single record. A rundown value is fashioned for each record if you take in an SQL aggregate function, such as Sum or Count, in the selected statement.

The Access group by clause comes after the where clause of a query and before the optional having clause in the query.

Step 1 -- Creating query

Consider this sample database of products. What if you want to group the results according to a specific condition? For that, we will apply Group By clause to some of the fields of this table.

To create the ms access query, open the Create Tab and then click on the Query Design option in the "other" Section.

Now let's group the products according to the categories. For that, we will select the products table from the show table window.

Step 2 -- Selecting fields

From the products table, let's select the suppliers ID filed, Product Name field and the Category field. After that, we will click on the total icon on the menu bar above.

Step 3 -- Running the query

Now let's run the query in ms access and a table would be displayed with the Products table grouped according to the suppliers and displaying the product name and category along with them.

This means that we have successfully created a group by clause, displaying the data according to a specific condition, which in this case is according to supplier ID arranged in the ascending order.

And in this way you can group data in ms access.
Рекомендации по теме
Комментарии
Автор

❗ Subscribe To Our Main YouTube Channel

howtechoffice
Автор

That is not group by -- that is just a sort -- group by would have aggregated the data on some level.  What this video did could have been done with out ever hitting the totals button.

robbyrd
Автор

You didn't say anything about how the Group By option is added to a field. Apparently clicking the Totals button is what does it but you never explained that. I just tried it and see that it adds Group By to EVERY field in the query. Then I guess you remove it from all but the desired fields.

kelleycanon
Автор

how about to sort products by selecting a sub category whihc sorts the other products?

sincronex
Автор

Could he perhaps talk a little faster????

lindaperrucci
Автор

Need the SQL view, not that noob stuff

puni