This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > February 2004 > Easy one add values
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Easy one add values
|
|
|
| Hi,
This might be an easy one, just cant find how to code it.
I have 2 variables which I want to add (strBalance and strLink) the values
could be: 500+300 = 800.
The problem is that my code is instead adding them like this: 500+300 =
500,300
Below is the code.
------------------------------------------------
For iLoop = 0 to iCount
strLink = Request(iLoop & ".Link")
strBalance = Request(iLoop & ".Balance")
strID = Request(iLoop & ".ID2")
strSQL = "UPDATE BillingLines SET PmtRecd = " & strBalance + strLink & " "
&_
" WHERE Id = " & strID
----------------------------------------------------------
How can I do the code so that it adds correctly ?
Appreciate any help !
Axi
| |
|
| Another try that failed:
I tried:
For iLoop = 0 to iCount
strLink = Request(iLoop & ".Link")
strBalance = Request(iLoop & ".Balance")
strID = Request(iLoop & ".ID2")
strSQL = "UPDATE BillingLines SET PmtRecd ='strBalance' - 'strLink'" &_
" WHERE Id = " & strID
------------------------------
I get this error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid operator for data
type. Operator equals subtract, type equals varchar.
/bluedot2004/Intranet/Cases/Billing/Payments/PaymentSavedUpdatebillines.asp,
line 30
Any clues ?
Axi
"Axi" <axiaxi2003@hotmail.com> wrote in message
news:c1u4fe$k7q$1@forums.macromedia.com...
> Hi,
>
> This might be an easy one, just cant find how to code it.
> I have 2 variables which I want to add (strBalance and strLink) the values
> could be: 500+300 = 800.
>
> The problem is that my code is instead adding them like this: 500+300 =
> 500,300
>
> Below is the code.
>
> ------------------------------------------------
> For iLoop = 0 to iCount
> strLink = Request(iLoop & ".Link")
> strBalance = Request(iLoop & ".Balance")
> strID = Request(iLoop & ".ID2")
> strSQL = "UPDATE BillingLines SET PmtRecd = " & strBalance + strLink & "
"
> &_
> " WHERE Id = " & strID
> ----------------------------------------------------------
>
> How can I do the code so that it adds correctly ?
>
> Appreciate any help !
>
> Axi
>
>
| |
|
| Another one failed - all fields are "money" type in the MS SQL Database.
Also tried this :
For iLoop = 0 to iCount
strLink = Request(iLoop & ".Link")
strBalance = Request(iLoop & ".Balance")
strID = Request(iLoop & ".ID2")
strSQL = "UPDATE BillingLines SET PmtRecd = 'strBalance' + 'strLink'" &_
" WHERE Id = " & strID
Got this errror:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit
conversion from data type varchar to data type money, table
'BlueDotLocal.dbo.BillingLines', column 'PmtRecd'. Use the CONVERT function
to run this query.
/bluedot2004/Intranet/Cases/Billing/Payments/PaymentSavedUpdatebillines.asp,
line 30
"Axi" <axiaxi2003@hotmail.com> wrote in message
news:c1u4fe$k7q$1@forums.macromedia.com...
> Hi,
>
> This might be an easy one, just cant find how to code it.
> I have 2 variables which I want to add (strBalance and strLink) the values
> could be: 500+300 = 800.
>
> The problem is that my code is instead adding them like this: 500+300 =
> 500,300
>
> Below is the code.
>
> ------------------------------------------------
> For iLoop = 0 to iCount
> strLink = Request(iLoop & ".Link")
> strBalance = Request(iLoop & ".Balance")
> strID = Request(iLoop & ".ID2")
> strSQL = "UPDATE BillingLines SET PmtRecd = " & strBalance + strLink & "
"
> &_
> " WHERE Id = " & strID
> ----------------------------------------------------------
>
> How can I do the code so that it adds correctly ?
>
> Appreciate any help !
>
> Axi
>
>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|