Re: Storing Database Result Field in a Variable.



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










.



Relevant Pages

  • Storing Database Result Field in a Variable.
    ... I have an ASP page that displays records from a SQL database, how do I store ... I need to use this as a total after displaying ... CostType = 'MT114')) AS TotalTax, ...
    (microsoft.public.frontpage.programming)
  • Re: Synchronizing the Main form and six (6) subforms?
    ... either just displaying the fields that relate the particular ShipType on the ... Am I to add this field to my one big table; and, how do I store ... >>> shipment to the correct main record. ...
    (microsoft.public.access.formscoding)
  • Re: DefaultTableModel() is a crap / How to hide a Table column?
    ... Mark Sizzler wrote: ... > It all started with my search for a possibility to store data values in a JTable without displaying it. ... You said "What a poor system architecture." ...
    (comp.lang.java.gui)
  • Saving AJAX responseText to a variable
    ... function ajaxObjectStateChange() ... retrieve, but it always come up as undefined (or a empty string if I ... I can never get the data to store in the variable. ... find on the web are the ones for immediately displaying the data. ...
    (comp.programming)
  • IWMPSubscriptionService::allowPlay and Stock Dialogs
    ... unexpected problem that I hope is easily solved. ... but media player is displaying a stock dialog which says "Windows ... Media Player cannot play the protected file. ... contact the online store from which you ...
    (microsoft.public.windowsmedia.sdk)