Storing Negative Numbers

  • Lynn Pettis (8/12/2010)


    Ninja's_RGR'us (8/12/2010)


    Lynn Pettis (8/12/2010)


    CELKO (8/12/2010)


    tymberwyld (11/10/2008)


    Along with a lot of other horrible decisions, I am now not allowed to use Negative numbers in any database design. Instead, I need to add another column (ex. Operator) which tells whomever that the data in the amount column is either Positive or Negative. Huh? Is there something I missed during my last 10 years designing databases?

    They are insane. Time to update the old resume 🙂

    You do realize that the last post in this thread is about 21 months ago, right?

    Still, it's a good advice. :w00t:

    Perhaps, but what good is good advice if delivered late?

    Good advice is only good when delivered in a timely fashion. When it comes too late, then it is only useful to somebody else who may perchance the thread. It is useless thoughts to the person at whom the advice is directed at this point.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Well, not entirely useless, I got a good laugh as I thought about this 'ole job. Moved on to bigger and better things...so the advice was taken 😛

  • tymberwyld (8/12/2010)


    Well, not entirely useless, I got a good laugh as I thought about this 'ole job. Moved on to bigger and better things...so the advice was taken 😛

    My apologies then. As long as you got a laugh then it is useful:-D

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Lynn Pettis (8/12/2010)


    Ninja's_RGR'us (8/12/2010)


    Lynn Pettis (8/12/2010)


    CELKO (8/12/2010)


    tymberwyld (11/10/2008)


    Along with a lot of other horrible decisions, I am now not allowed to use Negative numbers in any database design. Instead, I need to add another column (ex. Operator) which tells whomever that the data in the amount column is either Positive or Negative. Huh? Is there something I missed during my last 10 years designing databases?

    They are insane. Time to update the old resume 🙂

    You do realize that the last post in this thread is about 21 months ago, right?

    Still, it's a good advice. :w00t:

    Perhaps, but what good is good advice if delivered late?

    I use google all the time for sql stuff (after I can't find what I need here) and yet every so often I get back to a thread here.

    Just today I was stuck in ssrs and I found a 2-3 years old thread here that got me unstuck. So I can only imagine how many people are finding that thread even years later which could use that advice.

    Anyhow, the thread age is usually the last thing on my mind when I use google. I only care about getting my stuff done and finding the answers I need.

    And a good laugh is always a great bonus.

  • Grant Fritchey (11/10/2008)


    Not unless I've missed it to. If the value of a number is -3, it's -3, not 3 with some negative sign kept elsewhere that may or may not change it. That's a bit of a freaky design. Although, I'd have to check with an accounting friend for the details, I think there is a method of accounting whereby you designate everything as a value and then describe the value as either a credit or debit, + or -, maybe that's what you're dealing with.

    This is an old thread, but I would point out that SAP stores accounting entries as positive numbers and uses another field to indicate whether the amount is a debit or credit. That's easy enough to deal with once you know, except that the indicators are H and S, the German abbreviations for the terms. Data entry in SAP is affected as well, as the user has to enter the amount, then enter a posting key that determines whether the amount is a debit or credit, as well as implying some other information. For a standard entry, debits are entered with a posting key of 40, credits with a posting key of 50. This was totally non-intuitive when I started using SAP after years of entering credits as negative numbers.

  • Ross McMicken (8/13/2010)


    Grant Fritchey (11/10/2008)


    Not unless I've missed it to. If the value of a number is -3, it's -3, not 3 with some negative sign kept elsewhere that may or may not change it. That's a bit of a freaky design. Although, I'd have to check with an accounting friend for the details, I think there is a method of accounting whereby you designate everything as a value and then describe the value as either a credit or debit, + or -, maybe that's what you're dealing with.

    This is an old thread, but I would point out that SAP stores accounting entries as positive numbers and uses another field to indicate whether the amount is a debit or credit. That's easy enough to deal with once you know, except that the indicators are H and S, the German abbreviations for the terms. Data entry in SAP is affected as well, as the user has to enter the amount, then enter a posting key that determines whether the amount is a debit or credit, as well as implying some other information. For a standard entry, debits are entered with a posting key of 40, credits with a posting key of 50. This was totally non-intuitive when I started using SAP after years of entering credits as negative numbers.

    I never thought that thinking about accounting reports and queries would make me feel like a teen again, But all I can think is OMG, OMG...

  • It is an old thread but same goes here... OMG... Debit/Credit columns meaning one thing in Accounts Payable and meaning just the opposite in Accounts Receivable. And you had to make entries in both because of "double entry accounting". I don't know if they still do it but that's the way QuickBooks used to work behind the scenes, as well.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 7 posts - 31 through 36 (of 36 total)

You must be logged in to reply to this topic. Login to reply