Hi Pat
Just in case anyone reading your post was a trifle confused, I thought it might be useful to illustrate this with some real data of my own
The attached database has approx 44000 records listing the number of merit points and demerit points awarded to 1449 students
I have replaced all zero values with nulls for the sake of this exercise
There are 4 versions of the same query. All have 3 calculated columns:
a) Expr1: Sum([MeritPts])+Sum([DemeritPts])
b) Expr2: Nz(Sum([MeritPts]+[DemeritPts]),0)
c) Expr3: Sum(Nz([DemeritPts],0))+Sum(Nz([MeritPts],0))
The first query lists all 1449 records - one per student
The 2nd only lists those where Expr1<>Expr2 - 801 records
The 3rd only lists those where Expr1<>Expr3 - NO RECORDS
The 4th only lists those where Expr2<>Expr3 - 1445 records
Now obviously all 3 expressions can't be correct so which should you use?
Well I could be awkward by saying it depends what result you want .... but that's being disingenuous.
In practical terms. one of them is DEFINITELY correct, another DEFINITELY wrong
The third is ... well I'll leave you to decide
And the order has (possibly) been changed to protect the innocent.
In line with Pat's original post, I know the answer(s) but rather than tell you, its more instructive to work it out for yourself!
Its important to note that in the original data I had zeroes rather than nulls in MeritPts & DemeritPts fields.
In that situation, all 3 expressions are IDENTICAL for all students and therefore all are correct
BUT if there is any chance of a null, you've got to know which one(s) to use!
Hope that helps rather than confuses anyone even more ...
Of course, all of this is totally irrelevant to the actual example in the original post as it doesn't have a sum of 2 fields !!!
Over and out!