From: Song on
I have 2 fields in query. Qty1 and Qty 2. I added Total:qty1+qty2.
However, if qty1 has some number but qty2 is blank, my total is blank,
instead of just show the sum.
From: John Spencer on
In Access

You need to use the NZ function to force a ZERO. Or use an IIF clause.

Total: Nz(Qty1,0) + Nz(Qty2,0)

or

Total: IIF(Qty1 is Null,0,Qty1) + IIF(Qty2 is Null,0,Qty2)

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Song wrote:
> I have 2 fields in query. Qty1 and Qty 2. I added Total:qty1+qty2.
> However, if qty1 has some number but qty2 is blank, my total is blank,
> instead of just show the sum.
From: Arvin Meyer [MVP] on
Use the following expression:

Total: NZ([Qty1],0) + NZ([Qty2],0)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"Song" <song.usa(a)gmail.com> wrote in message
news:03cd803a-1a27-4622-97dd-f7dedf123356(a)v12g2000prb.googlegroups.com...
>I have 2 fields in query. Qty1 and Qty 2. I added Total:qty1+qty2.
> However, if qty1 has some number but qty2 is blank, my total is blank,
> instead of just show the sum.