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

  • Home
  • SEARCH
  • 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 6856161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:51:01+00:00 2026-05-27T01:51:01+00:00

I have the following code: SELECT -701385.10 — -701385.10 SELECT SUM(-701385.10) — -701385.10 SELECT

  • 0

I have the following code:

SELECT -701385.10 -- -701385.10
SELECT SUM(-701385.10) -- -701385.10
SELECT -701385.10/2889991754.89 -- -0.000242694498630
SELECT SUM(-701385.10)/2889991754.89 -- -0.000242

In the last SELECT the result is truncated to 6 decimal places. I’ve read through the Precision, Scale, and Length article and unless my working is wrong, I can’t understand why the truncation is occurring. The type of the expression SUM(-701385.10) should be DECIMAL(38,2) – see SUM – so the type resulting from the division should have:

Precision:

  • p1 – s1 + s2 + max(6, s1 + p2 + 1)
  • 38 – 2 + 2 + max(6, 2 + 10 + 1)
  • 38 – max(6,13)
  • 38 – 13
  • 25

Scale:

  • max(6, s1 + p2 + 1)
  • max(6, 2 + 10 + 1)
  • max(6, 13)
  • 13

So why are the decimal places being truncated?

  • 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-05-27T01:51:01+00:00Added an answer on May 27, 2026 at 1:51 am

    Your working is wrong

    Precision: p1 - s1 + s2 + max(6, s1 + p2 + 1)
    Scale: max(6, s1 + p2 + 1)
    

    Gives

    Precision: 38 - 2 + 2 + max(6, 2 + 12 + 1) = 53
    Scale: max(6, 2 + 12 + 1)                  = 15
    

    Which is greater than 38 so you are getting truncation as covered here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code $result = $handle->select()->from('store_details') ->where('store_details.store_id=?', $id) ->columns('store_details.store_name'); //->query(ZEND_DB::FETCH_OBJ); However, when
THANKS EVERYONE - SOLVED! I have the following code: SELECT region, division, SUM(staff_count) AS
I have the following code CSS select.select { color:#FFFFFF; height: 15px; width: 105px; background:#996633
I have the following mySQL code: SELECT c.categoryId, c.categoryName, c.categoryParent, c.categoryDescription, COUNT(p.productid) as totalProdsInCategory
I have following code return (EseshEntities.Current.Users.Select(u => new { Comunity = u.Apartment.Building.District.City })).ToList(); if
I Have following code with LINQ var q = (from web in DataContext.Webs select
I have the following code: function isValidAuthor($authorID){ $query = SELECT * FROM jos_users WHERE
I have the following code that prompts the user to select a range of
I have the following code <select id=practice_id name=practice column=practice style=width: 200px> <option value=>Default</option> <option
I have the following code in html: <select> <option text=item9 value=9></option> <option text=item10 value=10></option>

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.