2 variables won't add??

Results 1 to 2 of 2

Thread: 2 variables won't add??

  1. #1
    glen Guest

    Default 2 variables won't add??

    i&#039;m trying to add 2 currencies and they won&#039;t add or at least display for me. Here&#039;s an example of the code:<BR><BR>set a=conn.execute("SELECT * FROM tblPrevious WHERE tblPrevious.PreviousID=" &Session("NewPreviousKey"))<BR>set b=conn.execute("SELECT * FROM tblPaychecks WHERE tblPaychecks.PaycheckID=" &Session("NewPaychecksKey"))<BR><BR>int=a(1) + b(1)<BR>Response.Write(int)<BR> **note: my SQL statements work fine and the database tabales are set for currencies. If I go: Response.Write(a(1)), I can see the variable but not if I add them together. I&#039;ve also tried this: <BR><BR>int=CCur(a(1)) + CCur(b(1))<BR>no luck...any ideas for the math wiz?

  2. #2
    Join Date
    Dec 1969

    Default RE: 2 variables won't add??

    What happens if you do this:<BR><BR> Response.Write "Now adding " & a ("fldname") & " and b ("fldname") <BR><BR> varA = CInt( a ("fldname") )<BR> varB = CInt( b ("fldname") )<BR> int = varA + varB<BR><BR> Response.Write "The answer is: " & int<BR><BR>That&#039;s what I do when I can&#039;t get something to work (which is not a rare occurance), I take the problem back to a simpler level and get it working from there.<BR><BR>HTH<BR><BR>Darren<BR>[ darren@showusyourcode.com ]<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts