P
Pierre de Beer
Good Day
I have an ASP page that displays records from a SQL database, how do I store
a result field to a variable. I need to use this as a total after displaying
all the records.
FrontPage is showing the total field in each record, and I only want to
display the total at the end of the page. I can hide the fields but are not
able to store the value to a variable.
This is my SQL query
SELECT Trans_Date, Amount, D_C, Tax, Amount_Description, Account_Number,
Tenant_Number, Date_Valid_To, AppId, CostType,
(SELECT SUM(AmountToSum) FROM CostsPaidDetail WHERE (AppId = ::AppId:: AND
CostType = 'MT114')) AS Total,
(SELECT SUM(TaxToSum) FROM CostsPaidDetail WHERE (AppId = ::AppId:: AND
CostType = 'MT114')) AS TotalTax,
FROM CostsPaidDetail
GROUP BY Trans_Date, D_C, Tax, Amount_Description, Account_Number,
Tenant_Number, Date_Valid_To, AppId, CostType, Amount
HAVING (Amount <> '0') AND (AppId = ::AppId:: AND CostType =
'MT114')
The fields that I need to store to the variable are "Total" and "TotalTax"
Any help will be appreciated.
Kind Regards
Pierre
I have an ASP page that displays records from a SQL database, how do I store
a result field to a variable. I need to use this as a total after displaying
all the records.
FrontPage is showing the total field in each record, and I only want to
display the total at the end of the page. I can hide the fields but are not
able to store the value to a variable.
This is my SQL query
SELECT Trans_Date, Amount, D_C, Tax, Amount_Description, Account_Number,
Tenant_Number, Date_Valid_To, AppId, CostType,
(SELECT SUM(AmountToSum) FROM CostsPaidDetail WHERE (AppId = ::AppId:: AND
CostType = 'MT114')) AS Total,
(SELECT SUM(TaxToSum) FROM CostsPaidDetail WHERE (AppId = ::AppId:: AND
CostType = 'MT114')) AS TotalTax,
FROM CostsPaidDetail
GROUP BY Trans_Date, D_C, Tax, Amount_Description, Account_Number,
Tenant_Number, Date_Valid_To, AppId, CostType, Amount
HAVING (Amount <> '0') AND (AppId = ::AppId:: AND CostType =
'MT114')
The fields that I need to store to the variable are "Total" and "TotalTax"
Any help will be appreciated.
Kind Regards
Pierre