I'm not getting the totals for columns; net_total, gross_amount_total and vat_amount_total. Instead, ASP is printing out the 1st record net, vat and gross records rather than a total for each of these columns.
The SQL is saying Select these fields between 2 dates WHERE user is e.g. 'user12' AND the costcode is e.g. '1'
SQL_TOTALS = "SELECT pccc.costcode_id,
pccc.costcode_owner, pctl.tl_date, SUM(pctl.tl_net) AS
net_total"
SQL_TOTALS = SQL_TOTALS & ",SUM(pctl.tl_vat_amount) AS
vat_amount_total"
SQL_TOTALS = SQL_TOTALS & ", SUM(pctl.tl_gross_amount)
AS gross_amount_total "
SQL_TOTALS = SQL_TOTALS & "FROM
PurchaseCardCostCodes pccc INNER JOIN
PurchaseCardTransactionLog pctl ON pccc.costcode_id =
pctl.costcode_id"
SQL_TOTALS = SQL_TOTALS & " WHERE pctl.tl_date
BETWEEN '"&DateOne&"' AND '"&DateTwo&"'"
SQL_TOTALS = SQL_TOTALS & " AND pccc.costcode_owner
= '"&User&"'"
SQL_TOTALS = SQL_TOTALS & " AND pccc.costcode_id
= '"&RadioButtonVal&"'"
SQL_TOTALS = SQL_TOTALS & "GROUP BY pccc.costcode_id,
pccc.costcode_owner, pctl.tl_date"