Home | Advertising Info93 USERS CURRENTLY ONLINE   
   Site Search Contact Us Sunday, August 14, 2022  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
SQL Queries
 PowerASP Code Help Area : SQL Queries
Subject Info: sql statement for sum A d d  -  P o s tAdd P o s t
Message << Prev Info | Next Info >>

Joined: November/06/2004
Location: Brazil
Online Status: Offline
Info: 27
Added: February/12/2005 at 8:44pm | IP Logged Quote mjunior

Hello there,

I'm trying to use the select sum in order to summary the total comission grouped by vendor name...
The statement goes well at start but it seems I'm only allowed to use the variables I choose to sum or grop instead have access to all...so I've some errors when I tried to response.write this vriables.

My sql is below:
"SELECT Sum (valorfinalproposta)AS comissao FROM tab_CadVendas WHERE fimcadvenda = 's' AND fimcadnotafisc = 's' GROUP BY indicaprojeto", conBD

Please help me.

Back to Top View mjunior's Profile Search for other info by mjunior

Joined: June/01/2005
Online Status: Offline
Info: 3
Added: June/02/2005 at 9:27am | IP Logged Quote chrscote

Include any fields you want to the SELECT statement either before the Sum(...) AS ... or after.  For example, to access all fields, you would write:

SELECT Sum(valorfinalproposta) AS comissao, fimcadvenda, fimcadnotafisc FROM tab_CadVendas WHERE fimcadvenda='s' AND fimcadnotafisc = 's' GROUP BY indicaprojeto"

Sum(valorfinalproposta) AS comissao acts as a single field in the SELECT statement.


Back to Top View chrscote's Profile Search for other info by chrscote

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2022 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com