473,498 Members | 703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

COALESCE a Session Var ASP

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

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

Thank you
Oct 23 '08 #1
1 4800
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
Oct 23 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4636
by: Bob Bedford | last post by:
I've a query like this: select coealesce(table1.code1, table2.code1) as mycode from... where mycode = 'XXX' But this query fails. Unknow column mycode in where clause. why ??? "coalesce()...
2
4767
by: Jeff Roughgarden | last post by:
I am using a clever product called SQL Expert Pro to optimize problematic SQL statements. It works by generating syntactically identical variations of the original SQL, finding all unique execution...
3
9201
by: Steffen Vulpius | last post by:
Hi everybody, VARCHAR has a higher precedence than CHAR. If you have a query SELECT COALESCE(c1,c2) FROM T1 where c1 is CHAR(5) and c2 is VARCHAR(10), I would expect the return type to be...
5
5984
by: John Greve | last post by:
Any ideas on why my the result 'green' row column DELTA does not yield -1 for? That is not how I expected COALESCE( ... ) to work. Every other row for DELTA (including 'black') comes out the...
3
1459
by: darrel | last post by:
I have three tables making a many-to-many relationship: Companies CoID | CoName Link CoID | InsID Insurers InsID | InsName
4
4727
by: Don | last post by:
If I have an SQL query which returns an aggregate of several decimal fields like so: (sum(COALESCE(myDecimal1, 0)+ sum(COALESCE(myDecimal2, 0)+ sum(COALESCE(myDecimal3, 0)) as MyTotal I get...
10
3837
by: db2group88 | last post by:
hi, we are using db2 v8.2 EE on windows, with jcc driver. try to create a join view, after that i check the syscat.columns table, for those decimal field use COALESCE method, all the length become...
2
10479
by: raysefo | last post by:
Hi, I m trying to use coalesce but i m getting this error below, btw i m using db2 8.2. what i m doing is; .... where eh.toblm = coalesce(NULL,eh.toblm) SQL0206N "NULL " is not valid in the...
1
28794
by: r035198x | last post by:
This is a short tip describing the sql coalesce function. Description COALESCE accepts a comma separated list of parameters and returns the first value that is not null in that list or null...
0
7124
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.