Re: Storing Database Result Field in a Variable.
- From: "Pierre de Beer" <pierre@xxxxxxxxxxxxxxx>
- Date: Tue, 18 Jul 2006 13:20:56 +0200
Thank You for the help but I still can not get this to work, I attempted
Total = obRS("Total") and Total = obRS(Total) and get the eror;
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'obRS'
/SLReport/CostsPaidDetail.asp, line 185
Any idea why?
Kind Regards
Pierre
"Pierre de Beer" <pierre@xxxxxxxxxxxxxxx> wrote in message
news:OQ7DczfqGHA.2108@xxxxxxxxxxxxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: Storing Database Result Field in a Variable.
- From: Stefan B Rusynko
- Re: Storing Database Result Field in a Variable.
- Prev by Date: RE: How to pass a parameter into the Database Result Wizard ???
- Next by Date: Re: Submit
- Previous by thread: Re: Storing Database Result Field in a Variable.
- Next by thread: Re: Storing Database Result Field in a Variable.
- Index(es):
Relevant Pages
|
|