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. Advertising

  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. Advertising

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:
    360
    rooster575
    Dec 2, 2003
  2. thomson
    Replies:
    10
    Views:
    2,493
    Eliyahu Goldin
    Jun 20, 2005
  3. thomson
    Replies:
    0
    Views:
    380
    thomson
    Jun 20, 2005
  4. darrel
    Replies:
    3
    Views:
    437
    darrel
    Mar 8, 2006
  5. Fred
    Replies:
    3
    Views:
    326
    Alf P. Steinbach
    Aug 10, 2003
Loading...

Share This Page