0

I have the following Query:

enter image description here

I want the QTotal to show the total of the Q1 to Q4 fields but it comes up blank.

I have tried:

 Qtotal: Nz([Q1])+Nz([Q2])+Nz([Q3])+Nz([Q4])

but this throws and exepction the first time the query is run and then it works.

enter image description here

Any thoughts?

1
  • Obviously, that's a VBA error, not an SQL one. Share the relevant VBA. How are you calling this query? Commented Feb 24, 2020 at 12:53

1 Answer 1

1

You need to re-write that query using IIf(IsNull... instead of Nz(... Pretty sure there are some incompatibility issues with the Nz function.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect. Changed to Qtotal: IIf(IsNull([Q1]),0,[Q1])+IIf(IsNull([Q2]),0,[Q2])+IIf(IsNull([Q3]),0,[Q3])+IIf(IsNull([Q4]),0,[Q4]) and all good. I guess that is what you meant Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.