CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 compute sum problem

Print topic Send  topic

Author Message
coyote999

Posts: 22
Posted: 02/08/2004, 6:32 PM

Hi all!

I have a little problem with the "compute sum" syntax.

SELECT X1, X2, X3
FROM table
ORDER BY X1
COMPUTE SUM(X1), BY X2

In the query, i only get the values of the table
But i want the sum of the values of X1

Can anyone help?:-)

Greetings
Martin
View profile  Send private message
peterr


Posts: 5971
Posted: 02/08/2004, 10:57 PM

This may be difficult to answer without knowing which database (and version) you're using.
Many databases won't allow such syntax and you would rather do:
SELECT Sum(X1), X2, X3
FROM table
GROUP BY X2, X3
ORDER BY Sum(X1)

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
coyote999

Posts: 22
Posted: 02/09/2004, 3:02 AM

Hi!

I use MS-SQL.
View profile  Send private message
peterr


Posts: 5971
Posted: 02/09/2004, 3:15 PM

Well, I also asked about the version (of the database), while it would be good know even more about your environment, including the programming language and the database driver you're using.
Generally I can only say that the COMPUTE statement is not fully supported by Microsoft, not supported by all drivers, possibly even being phased out. See:
http://groups.google.com/groups?th=903fdf9123cef201&see...1.phx.gbl#link5

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.