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 8635749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:03:10+00:00 2026-06-12T10:03:10+00:00

I have 2 values in my inventory database. One is the QtyOnHand (float), and

  • 0

I have 2 values in my inventory database. One is the QtyOnHand (float), and the other is a calculation of all the inventory transactions for that item (think SUM(TransQty) where transQty is also a float). Problem is, over time for unknown reasons some of these values fall out of sync. So now I’m trying to clean them up.

Basically, I’m taking QtyOnHand (which we are declaring as accurate), and subtracting the transaction total from that. Then making a correction entry into transactions for the difference. This works great until we get to numbers with lots of “decimal dust”. Also, float seems to display 0 even in cases where the actual value is more like 0.0000000000000000237.

Here are some data that I’m having trouble correcting.

Example Data

The items with scientific notation are giving me trouble. Even the line showing Item PLXL-105-H, which shows -18, -18 is not displaying accurately, because my query is only returning values that are outside of 1% mismatch. I’ve been working entirely in TSQL, would it help to manipulate the values from C# program?

So, here’s my question: how should I handle these numbers? I’ve tried converting them to DECIMAL(38,38), but that gives me arithmetic overflow. I need to get an accurate value representing the difference, then use that value to balance things out.

  • 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-12T10:03:11+00:00Added an answer on June 12, 2026 at 10:03 am

    How are you trying to make the entry?

    Doing something like:

    with to_update as (
         select itemNumber, QtyOnHand, TransBal
         from t
    )
    update tb_table
        set offset = TransBal - QtyOnHand
        from to_update
        where to_udpate.itemNumber = tb_table.itemNumber
    

    should do the trick.

    I sounds like you are trying to take the data out of the database, manipulate it, and then put it back in. If you stay within the database, you won’t have a problem, because the values never get converted to strings.

    By the way, for the decimal conversion, you should use decimal(38,19) or something. The scale parameter is for the number of digits to the right of the decimal point, so setting it to 38 only represents numbers between -1 and 1.

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

Sidebar

Related Questions

I have values that have decimals that I would like to store in a
I have values that are 64-bit unsigned ints, and I need to store them
I have this query to fetch the total OrderStatus that have values 1 and
I am attempting to pull the EXIF information for images that have values for
I have serialize values in data base, i fetch them from database then when
In our inventory database (SQL Server 2008 std edition) we have a table (called
I have a method, which generates a dictionary of returned values from database: -
Good Afternoon All, I have a wizard control that contains 20 textboxes for part
I have written a java application that sporadically logs events to an SQLite database
I have two database tables, Categories and SuperCategories, for an inventory control system I'm

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.