By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Null values in a query

P: 46

The following is a query the returns the total sq. footage of products that are in a category named "Cabinets". I am trying to figure out how to get it to return a zero when there is no footage instead of a null value. I have tried to use the NZ function, but can't seem to find the right place to put it. Can anyone help?

SELECT DISTINCTROW qrySqFtShippedLW.Area, Sum(qrySqFtShippedLW.[Sum Of SqFtShipped]) AS [Sum Of Sum Of SqFtShipped]
FROM qrySqFtShippedLW
GROUP BY qrySqFtShippedLW.Area
HAVING (((qrySqFtShippedLW.Area)="Cabinets"));

Mar 8 '10 #1
Share this Question
Share on Google+
2 Replies

P: 106
Please put all your coding within the Code brackets.

you can use the ISNULL function

Add a new column to your query as indicated below and change the values to suit your needs:
Expand|Select|Wrap|Line Numbers
  1. NewColumn:iif(Isnull(YourSumField), 0, [YourSumField])
see how this goes for you.
Mar 8 '10 #2

P: 46
Thanks, Tasawer that worked great.
Mar 8 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.