adding session variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rob

    adding session variables

    Hi all,

    Very simple question, is it possible to add the contents of session
    variables?
    for example I have 2 session variables, product1 & product2 , if I try and
    add them I get a "type mismatch" error.

    i.e. total = session("produc t1") + session("produc t2")

    I've tried session("produc t1").contents or session("produc t1").value then I
    get an error of "object required".

    Any ideas?
    TIA
    Rob


  • Aaron Bertrand [MVP]

    #2
    Re: adding session variables

    Are they integers, decimals, ???

    You could try

    total = clng(session("p roduct1")) + clng(session("p roduct2"))

    --
    Aaron Bertrand
    SQL Server MVP



    Comment

    • rob

      #3
      Re: adding session variables

      Thanks, I cant belive I forgot that function, I was working with decimals
      so I'm using the Ccur one instead.
      Thanks for getting me on the right track. :o)

      "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
      news:%23gBv8OcG EHA.628@TK2MSFT NGP10.phx.gbl.. .[color=blue]
      > Are they integers, decimals, ???
      >
      > You could try
      >
      > total = clng(session("p roduct1")) + clng(session("p roduct2"))
      >
      > --
      > Aaron Bertrand
      > SQL Server MVP
      > http://www.aspfaq.com/
      >
      >[/color]


      Comment

      Working...