Null values in a query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmar93
    New Member
    • Mar 2008
    • 46

    Null values in a query

    Hi,

    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 qrySqFtShippedL W.Area, Sum(qrySqFtShip pedLW.[Sum Of SqFtShipped]) AS [Sum Of Sum Of SqFtShipped]
    FROM qrySqFtShippedL W
    GROUP BY qrySqFtShippedL W.Area
    HAVING (((qrySqFtShipp edLW.Area)="Cab inets"));

    thanks,
    Jeff
  • tasawer
    New Member
    • Aug 2009
    • 106

    #2
    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:
    Code:
    NewColumn:iif(Isnull(YourSumField), 0, [YourSumField])
    see how this goes for you.

    Comment

    • jmar93
      New Member
      • Mar 2008
      • 46

      #3
      Thanks, Tasawer that worked great.

      Comment

      Working...