Accounting and Database design, storing debit and credit amount

后端 未结 7 1667
执笔经年
执笔经年 2021-02-06 00:57

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:13

    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.

提交回复
热议问题