Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP (http://www.programmingforums.org/forum32.html)
-   -   Question about the SUM function in SQL (http://www.programmingforums.org/showthread.php?t=6784)

rag05 Nov 2nd, 2005 11:01 AM

Question about the SUM function in SQL
 
Hello,

If we have the following query (in ASP):


:

rs.Open "SELECT SUM(salary) FROM employees WHERE salary > 55000",db1
What is returned in case there are NO salaries > 55000?

Thanx for your help.

InfoGeek Nov 2nd, 2005 11:20 AM

I think it'll return NULL. Also use 'as' in your query like
:

rs.Open "SELECT SUM(salary) as total FROM employees WHERE salary > 55000",db1

then you can use it in further expressions.

Also, Animated avatars are not allowed on this forum. So change your avatar.

Edit: MyPosts%100==0!:)

InfoGeek Nov 2nd, 2005 11:31 AM

Anyways, Welcome to the forums.:)
One good thing to do after you join a forum is read the Forum Rules.

rag05 Nov 2nd, 2005 2:06 PM

Thanx
 
Thanx for your help and thanx for the info...

I already changed the avatar...

:D


All times are GMT -5. The time now is 2:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC