Accounting and Database design, storing debit and credit amount

后端 未结 7 1852
你的背包
你的背包 2021-02-06 00:47

QUESTION: In the case below should I have stored all my amount as positives decimal amounts then flag the amount as either being a \"Debit\" or \"Credit\" rather than storing d

7条回答
  •  别跟我提以往
    2021-02-06 01:11

    You can use the ABS function within sql server to get the absolute value. This would allow you to treat negative numbers as positive ones.

    eg:

    select ABS(-100)

    returns 100, not -100.

提交回复
热议问题