SunQuest
           MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 29th, 2000, 11:31 PM
ebryan ebryan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 21 ebryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I would like to use the Sum function for a page which shows orders in the database.

I use the following:

"Select Location, (Sum)OrderTotal from Orders Group by Location"

and get a very long string of numbers. The same phrasing works with Count but not with AVG or Sum.

The OrderTotal field is decimal type.

Does anyone know why this isn't working or have suggestions about getting a total?

Thanks.

Reply With Quote
  #2  
Old March 30th, 2000, 04:48 AM
tony styles tony styles is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 10 tony styles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The Syntax is wrong, Sum should not be in brackets (I dont know if you meant to do this). The syntax should be:
Select Sum(Order) instead.

Apart from that - it should work fine.
Make sure the column you are summing,
is a number type.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Using Sum function gets odd results


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway