E
E
ErickSkrauch2014-06-13 21:30:56
Microsoft Access
ErickSkrauch, 2014-06-13 21:30:56

Calculating the sum of income and expenses in Access?

I have an Access table. It stores account changes. They are defined by a sign (that is, greater than or less than 0). It is necessary to calculate separately the expenses and income for the month. There is nothing difficult with the choice of the month, but there were problems with the calculation.

I tried this and that, but either I'm too used to MySQL, or the skis don't go:

SELECT Sum(IIF([Финансы]![Счёт] > 0; `Счёт`; 0)) AS `Доход`, Sum(IIF [Финансы]![Счёт]<0; `Счёт`; 0) AS `Расход` ...

Access does not allow such a query in any way.

Help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
oldTV, 2014-06-14
@oldTV

Use the ABS function to remove the "-" sign

N
Nikolai Turnaviotov, 2014-06-15
@foxmuldercp

In my web version of accounting, I solved the issue using a slightly different algorithm.
The payment has its category, which, in fact, distinguishes an income item from an expense item. category "Food" or "Transportation" is unlikely to be profitable, unless you work in a cafe or in a taxi, in contrast to the category "Salary" or "Income from Grandma's apartment."
Again, the category is a filter for searching / grouping data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question