Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    4

    Lightbulb Unanswered: Calculating with null values

    I have 2 separate queries, one produces a total and one doesn't at the moment as the criteria are not met.

    I want to add the total field from both these queries together but becuase one is null value, the sum total is also null.

    In access I would have used nz([Qry_1].[Total])+nz([Qry_2].[Total]) to get over this but SQL/adp doesnt seem to understand this.

    Can you help?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    coalesce([Qry_1].[Total],0)+coalesce([Qry_2].[Total],0)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2005
    Posts
    4
    This worked perfectly - thanks so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •