Crosstab Query is a type of select query that calculates sum, average and other aggregates functions and then group the results into two sets of values. One, which is down the sides of the datasheet and another, is across the datasheet. You can also think of it as two dimension of a table.
There is an option of cross tab query wizard but it is limited with what you can do. So, it’s better to create your crosstab query from design view.
Well you can create cross tab query in design view also and it’s quiet better option too. As design view allows you more control over query design. It supports features that are not found in query wizard. So learn how to create a crosstab query in design view.
In normal select query, you can double-click a field in the top pane to make it appear in the bottom pane.
Here, in this example, we are going to use some of access in-built functions to aggregate some fields and also to display another fields and to display fields in easier way.
We have used the Format() function to display month section of the order date. Also the sum() function to perform a calculation on the Unit Price, Quantity, and Discount fields.
Tap to the run option from the ribbon to run the query. Alternatively, just switch to datasheet view. You can watch the query displays the value of the sip city field as row header and the result of Format () function as column header.
Sum() function result will appears wherever there is a value for the month.