User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 456,234 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,754 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser: Programming Forums
Views: 2319 | Replies: 1
Reply
Join Date: Oct 2007
Posts: 4
Reputation: aceasil is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aceasil aceasil is offline Offline
Newbie Poster

How do I divide the sum of 2 columns in sql 2000 server

  #1  
Nov 16th, 2007
Hi,

I've got 2 columns of numbers and need to divide the SUM of COLUMN 1 by the SUM of COLUMN 2.

I've tried
 (SUM(col_1))/(SUM(col_2)) 
AS col_3 but this doesnt work.

Please help.

Kind Regards

Asil
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 4
Reputation: aceasil is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aceasil aceasil is offline Offline
Newbie Poster

Re: How do I divide the sum of 2 columns in sql 2000 server

  #2  
Nov 16th, 2007
Hi,

Actually on second pass the query DOES work. However, now I have a different issue. How can i get the resultant column to give me results with decimal places?

Thanks

Asil
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Database Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Database Design Forum

All times are GMT -4. The time now is 5:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC