The above (Virtual web hosting) example assumes you want to see

The above example assumes you want to see subtotals based on users. Suppose that you wanted to subtotal by Item rather than by Customer. You could use the OurItemId, ItemName, and ItemPrice columns, with only the ItemPrice column set to Sum. Then enter meaningful aliases for the GridView s column headings, as shown in Figure 12-65. If you prefer to subtotal my month, rather than by customer or item, you ll need to use some custom expressions. In my example, the TransactionDate field contains the date of each transaction. You can use the following expressions to group by month number, month name, and year: MONTH(TransactionDate): Isolates the month number of the TransactionDate field. This field is for sorting purposes only, so you can clear its Output check box to hide it in the query results. Set its Sort Type to Ascending. MONTHNAME(TransactionDate): Isolates the month name from the TransactionDate. The Query Builder will change the syntax of this one slightly to read {fn MONTHNAM(TransactionDate)}. But don t worry about that. It happens automatically if, and only if, the specific expression you entered requires the modified syntax. You can just let it happen and not fret over it. YEAR(TransactionDate): Isolates the year of the TransactionDate. Set this item s Sort Type column to Ascending as well, so items are listed in month and year order. Figure 12-66 shows how you d use the expressions in the grid portion of the query. Notice that I m sorting by the month number and year, to get the records to be displayed in chronological order. As always, all fields except ItemPrice are set to Group By, since only ItemPrice needs to be totaled. Figure 12-65: Group By and Sum to subtotal by Item. 316 Part III: Personalization and Databases
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Leave a Reply