dbAggColumns

Calculate the sum, min or max of the active grid columns and store them in session variables. When a grid's SQL is available and dbAgg properties could then be used to construct the aggregate values. In the case of a stored procedure where user has no control over the source, it is not possible to obtain the aggregate values. Also, there are occasions that the aggregate values are used in places other than the bottom line of a grid. This property will provide these values at the time the grid is constructed. Only SUM. MIN and MAX are available at this time.

Property Syntax

Parameters Default Value Description
Type SUM Aggregate type - SUM, MIN or MAX
Colx   MUST be the column number and not the column field name.

The following code generates the SUM, MIN and MAX values from ACCESS query [Quarterly Orders by Product]. Note that this query cannot be executed as a table and must be executed as a stored procedure hence the regular dbAgg properties is not applicable.

<%
Set Access=Server.CreateObject("Asp.db")
Access.dbQuickProps= "1; NWIND;; Grid;;;;;1000;;;false;false"
Access.dbStoredProc="[Quarterly Orders by Product],2"
Access.dbAggColumns="SUM,3,4,5,6"
Access.aspdb
response.write("SUM of Column 3 = " & session("SV_AGGCOL_1_3") & "<BR>")
response.write("SUM of Column 4 = " & session("SV_AGGCOL_1_4") & "<BR>")
response.write("SUM of Column 5 = " & session("SV_AGGCOL_1_5") & "<BR>")
response.write("SUM of Column 6 = " & session("SV_AGGCOL_1_6") & "<BR>")
Access.dbQuickProps= "1; NWIND;; Grid;;;;;1000;;;false;false"
Access.dbStoredProc="[Quarterly Orders by Product],2"
Access.DBUnit=2
Access.dbAggColumns="MIN,3,4,5,6"
Access.aspdb
response.write("MIN of Column 3 = " & session("SV_AGGCOL_2_3") & "<BR>")
response.write("MIN of Column 4 = " & session("SV_AGGCOL_2_4") & "<BR>")
response.write("MIN of Column 5 = " & session("SV_AGGCOL_2_5") & "<BR>")
response.write("MIN of Column 6 = " & session("SV_AGGCOL_2_6") & "<BR>")
Access.dbQuickProps= "1; NWIND;; Grid;;;;;1000;;;false;false"
Access.dbStoredProc="[Quarterly Orders by Product],2"
Access.DBUnit=3
Access.dbAggColumns="MAX,3,4,5,6"
Access.aspdb
response.write("MAX of Column 3 = " & session("SV_AGGCOL_3_3") & "<BR>")
response.write("MAX of Column 4 = " & session("SV_AGGCOL_3_4") & "<BR>")
response.write("MAX of Column 5 = " & session("SV_AGGCOL_3_5") & "<BR>")
response.write("MAX of Column 6 = " & session("SV_AGGCOL_3_6") & "<BR>")
%>

Output

SUM of Column 3 = 144981.32
SUM of Column 4 = 145361.44
SUM of Column 5 = 135111.28
SUM of Column 6 = 165912.26
MIN of Column 3 = 8.64
MIN of Column 4 = 4.8
MIN of Column 5 = 13.5
MIN of Column 6 = 23.4
MAX of Column 3 = 10540
MAX of Column 4 = 7905
MAX of Column 5 = 3900
MAX of Column 6 = 4951.6

Notes

Nulls are ignored during the value testing and is not considered as Zeros. No user delimiters are accepted. All fields are delimited by commas.