| kmdwebdesign@gmail.com 2005-10-10, 6:16 pm |
| Hey all,
Just wondering if anyone can help.
I am having trouble adding two figures (eventually 7) from the same
recordset.
My Recordset is:
<%
Dim rs_budget_dollar
Dim rs_budget_dollar_numRows
Set rs_budget_dollar = Server.CreateObject("ADODB.Recordset")
rs_budget_dollar.ActiveConnection = MM_con_edu_STRING
rs_budget_dollar.Source = "SELECT * FROM budget_dollar WHERE tripid = "
+ Replace(rs_budget_dollar__MMColParam, "'", "''") + ""
rs_budget_dollar.CursorType = 0
rs_budget_dollar.CursorLocation = 2
rs_budget_dollar.LockType = 1
rs_budget_dollar.Open()
rs_budget_dollar_numRows = 0
%>
My Variable is:
<% DIM budget_dollar_total
budget_dollar_total = 0
budget_dollar_total =
(rs_budget_dollar.Fields.Item("budgetaccom_dollars").Value)+(rs_budget_dollar.Fields.Item("budgetcust_dollars").Value)
%>
$<%=(budget_dollar_total)%>
The fields in the database are both set to 'number' and both have
figures entered.
There are no issues regarding displaying these figures as they are both
being displayed above the variable itself.
So my page should look something like.
$100 + ((rs_budget_dollar.Fields.Item("budgetaccom_dollars").Value))
$200 + ((rs_budget_dollar.Fields.Item("budgetcust_dollars").Value))
-------
$300 (<%=(budget_dollar_total)%> )
The Error i'm receiving is:
Microsoft VBScript runtime error '800a000d'
Type mismatch
/admin/trips/view.asp, line 677
I have tried alternatives, such as giving each Value it's own Variable
and trying to add the two Variables, but this also does not work.
Thank you for any help offered.
Best regards,
Diana.
|