COALESCE a Session Var ASP

Discussion in 'ASP General' started by GTN170777, Oct 23, 2008.

  1. GTN170777

    GTN170777 Guest

    Hi All, is this the correct way to Coalesce a session var -

    <%Session("EMPLOYETOKENS") =
    tokens.Fields.Item(COALESCE(SUM("JBCLTokens"),0)).Value%> ?

    Thank you
     
    GTN170777, Oct 23, 2008
    #1
    1. Advertisements

  2. GTN170777

    Bob Barrows Guest

    GTN170777 wrote:
    > Hi All, is this the correct way to Coalesce a session var -
    >
    > <%Session("EMPLOYETOKENS") =
    > tokens.Fields.Item(COALESCE(SUM("JBCLTokens"),0)).Value%> ?
    >

    No, COALESCE is a T-SQL function. You should probably use it in the sql
    statement being used to generate your resultset:

    select ..., COALESCE(SUM("JBCLTokens"),0)) as SumJBCLTokens

    In vbscript, you will need to create your own Coalesce function since
    there is none built in.

    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Oct 23, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alvin Bruney

    Threads.. Session var lost, App var ok

    Alvin Bruney, Dec 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    543
    rooster575
    Dec 2, 2003
  2. VB Programmer
    Replies:
    2
    Views:
    563
    VB Programmer
    Jun 8, 2004
  3. thomson
    Replies:
    10
    Views:
    2,794
    Eliyahu Goldin
    Jun 20, 2005
  4. thomson
    Replies:
    0
    Views:
    553
    thomson
    Jun 20, 2005
  5. darrel
    Replies:
    3
    Views:
    503
    darrel
    Mar 8, 2006
  6. Fred
    Replies:
    3
    Views:
    489
    Alf P. Steinbach
    Aug 10, 2003
  7. Alex Vinokur
    Replies:
    4
    Views:
    682
    Ron Natalie
    Sep 24, 2003
  8. Tor Erik Soenvisen
    Replies:
    14
    Views:
    822
    Tim Roberts
    Nov 23, 2006
Loading...