Monday, March 19, 2012

Help with Query and Null

I have the following syntax
Sum([SalesQty1]+[SalesQty2]+[SalesQty3]+[SalesQty4]+[SalesQty5]+[SalesQty6]+[SalesQty7]+[SalesQty8]+[SalesQty9]+[SalesQty10]+[SalesQty11]+[SalesQty12])
AS YrSales
This works fine if none of the fields are NULL
How can I cater for the scenario where anyone of the fields could be null?
Thanks
found it eventually - isnull
"Ali" <nospamthanks@.iveenuf.com> wrote in message
news:uJ1XhduLFHA.1308@.tk2msftngp13.phx.gbl...
>I have the following syntax
> Sum([SalesQty1]+[SalesQty2]+[SalesQty3]+[SalesQty4]+[SalesQty5]+[SalesQty6]+[SalesQty7]+[SalesQty8]+[SalesQty9]+[SalesQty10]+[SalesQty11]+[SalesQty12])
> AS YrSales
> This works fine if none of the fields are NULL
> How can I cater for the scenario where anyone of the fields could be null?
> Thanks
>
>

No comments:

Post a Comment