Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    test for null (A2K SP3)

    I have a rptNCTaxReport whose field "Receipts After 90 Days" recently returned a null; therefore, some of the other fields did not calculate properly. I need to test for null and if null set the value to zero. I tried using the entire DSum function used in the field but exceeded the maximum field length. Any suggestions. I have attached a database.

    Thanks,

    Tom
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: test for null (A2K SP3)

    Try using Nz([Deductions],0) instead of [Deductions]

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: test for null (A2K SP3)

    Thanks for your suggestion, but still could not get the desired result. See attached database. I changed the initial rent date in tblRental so that there would be no rental over 90 days and changed the [deductions] as suggested.

    Tom
    Attached Files Attached Files

  4. #4
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: test for null (A2K SP3)

    Wrap your formula in the text box called Deductions in the NZ() function and the other boxes will calculate correctly
    =nz(DSum("[RoomProration]","qryNCTotalTaxExempt"," [PCity] = " & Chr(34) & [PCity] & Chr(34)),0)

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: test for null (A2K SP3)

    mbarron,
    Many thanks! That solved the problem.

    Tom

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: test for null (A2K SP3)

    You should have replaced [Deductions] with Nz([Deductions],0) everywhere instead of only once, but <!profile=mbarron>mbarron<!/profile>'s suggestion is much more efficient.

  7. #7
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: test for null (A2K SP3)

    Thanks for your assistance.

    Tom

Posting Permissions

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