Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Sum and Truncate in SQL 2005

Posted on 2009-02-10
Medium Priority
Last Modified: 2012-05-06
I am trying to calculate a sum but need to truncate the number BEFORE summing it up.
Basically I just need to add whole numbers so if a value is "0.25" I want to truncate the decimals off so it is just "0" and then perform the sum.

Something like this but obviously I need the correct syntax.

SELECT sum (truncate (Qty,1))

Question by:mattkovo
1 Comment
LVL 42

Accepted Solution

dqmq earned 375 total points
ID: 23605360
Select sum(floor(qty))

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question