Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:19:16+00:00 2026-06-07T01:19:16+00:00

I use the following query on the SQL Server 2008 database of a 3rd

  • 0

I use the following query on the SQL Server 2008 database of a 3rd party product to generate some reports.

SELECT ROUND(SUM(Price),0,1) AS SumNetPrice FROM Transactions

Eg

 SUM(Price): 1.2345678
 ROUND(SUM(Price),0,1): 1

This has worked fine until now and removed all of the decimal places. In fact curiously the result was truncated even if I didn’t specify the 3rd parameter as per the MSDN information http://msdn.microsoft.com/en-us/library/ms175003.aspx on the ROUND function.

The 3rd party company has now changed the data type of the Price column from ‘real’ to decimal(22, 7). Unfortunately this now means that I always get 7 decimal places even when I use the truncate option of the ROUND function. So now I get:

 ROUND(SUM(Price),0,1): 1.0000000

Shouldn’t the ROUND(expression,0,1) truncate the result so I don’t get any decimal places? How can I remove these decimal places from the result in the SQL query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:19:18+00:00Added an answer on June 7, 2026 at 1:19 am
    SELECT CAST(ROUND(SUM(Price),0,1) AS DECIMAL(22,0)) AS SumNetPrice FROM Transactions
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following SQL Server 2005/2008 query: Select [UID], [DESC] From SomeTable Order By
I am using PHP to query some data on SQL Server 2008 R2 and
I'm using Firebird 2.1. I could use some help creating the following query or
I have the following SQL Query: select Subjects.S_ID as ID, Subjects.S_ParentID as ParentID, Subjects.S_Name
When I try to use the Invoke-Sqlcmd cmdlet from SQL Server 2008 to execute
Using SQL Server 2008 R2 I'd like to create a table with the following
I am looking for an access query, but a sql server 2008 could be
I'm having some trouble with a SQL Server 2008 R2 (Express) installation. It seems
I'm currently working my way through the Microsoft SQL Server 2008 - Database Development
I'm using the following LINQ to SQL query on a SQL Server Compact DB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.