Adding fields sum

Gismo

Registered User.
Local time
Today, 15:13
Joined
Jun 12, 2017
Messages
1,298
Hi all,

Quick question
Below is a table with temporary data
I need to add fields together
Query comes out blank
What am I doing incorrectly?

Profit/Loss: Sum([Financial Summary Tbl]![Total Sales (UGX)]-([Financial Summary Tbl]![Total Purchase (UGX)]+[Financial Summary Tbl]![Salaries]+[Financial Summary Tbl]![Accets]+[Financial Summary Tbl]![Promotions])-[Financial Summary Tbl]![Stock Adjustment])

1669133087650.png


1669133423825.png
 
[Total Sales (UGX)] = NULL so the end result is NULL
same goes for ![Total Purchase (UGX)].
Use Nz to circumvent this problem

Code:
Profit/Loss: Sum(Nz([Financial Summary Tbl]![Total Sales (UGX)])
                -(Nz([Financial Summary Tbl]![Total Purchase (UGX)])
                 +Nz([Financial Summary Tbl]![Salaries])
                 +Nz([Financial Summary Tbl]![Accets])
                 +Nz([Financial Summary Tbl]![Promotions]))
                 -Nz([Financial Summary Tbl]![Stock Adjustment]))
 
[Total Sales (UGX)] = NULL so the end result is NULL
same goes for ![Total Purchase (UGX)].
Use Nz to circumvent this problem
I sum them all together, for November, there is figures for all

Just Profit/Loss is blank

But NZ seems to work just fine
Thank you

1669133821064.png
 
did you try using Nz?

If so, split the problem into smaller pieces.
Add a column profit/loss per record and see if there is any result before summing it all together.
 

Users who are viewing this thread

Back
Top Bottom