Results 1 to 3 of 3

Thread: addition with 0

  1. #1
    Join Date
    Mar 2006
    Posts
    42

    Unanswered: addition with 0

    My update function does not always work properly, especially when one of the fields is 0 or blank.How could i improve my function so that when addding wih 0 not to give 0 ?

    My function is the following:
    Public Function dummy()
    StrSQL = " UPDATE (products1 INNER JOIN products ON products1.Productid = products.Productid) INNER JOIN [Order Details1] ON " & _
    " products1.Productid = [Order Details1].productid SET products1.items1 = [order details1].[quantity]+[products1].[items1]"
    End Function

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Zero should be no problem, but a Null would be. You could wrap any potentially Null values in an Nz() function to get around it.
    Paul

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You could also stick a WHERE clause on the query to ignore those with an initial zero value.
    George
    Home | Blog

Posting Permissions

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