Help with variables

  • Thread starter Thread starter Aleks
  • Start date Start date
A

Aleks

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
 
Hello Aleks:
You wrote in conference microsoft.public.access.adp.sqlserver on Sun, 29
Feb 2004 22:23:38 -0500:

A> This might be an easy one, just cant find how to code it.
A> I have 2 variables which I want to add (strBalance and strLink) the
A> values could be: 500+300 = 800.

A> The problem is that my code is instead adding them like this: 500+300 =
A> 500,300

A> Below is the code.


A> strSQL = "UPDATE BillingLines SET PmtRecd = " & strBalance + strLink &
A> " " &_

A> How can I do the code so that it adds correctly ?


You probably declared strBalance and strLink as strings, that's why they are
concatenated. Change it to

.... & CDbl(strbalance) + CDbl(strlink) & ...


Vadim
 
uh or you can convert on the DB side.

that way you don't need to have such ugly VB.

i do everything i can on the DB side-- it just makes it more flexible

are you storing #s as text?

that sounds liek the root of the problem
 
Back
Top