Results 1 to 3 of 3

Thread: Adding textbox values with blanks

  1. #1
    Join Date
    Dec 2008
    Posts
    27

    Adding textbox values with blanks

    I can't see to add text boxes if the have blank value

    I have a textbox that returns a value from a query for each month.

    then I want to total them by quarters and then YTD.
    however when I add the textbox or the actual query column if any of the fields are 0 I get a blank return, yet if all the months have a value greater than 0 it works.
    here's 1 line of query
    Code:
    Sum(IIf(Month(date)=1,Balance,Null)) AS Jan_Bal, Sum(IIf(Month(date)=1,Settlement,Null)) AS Jan_Set, Count(IIf(Month(Date)=1,Settlement,Null)) AS Jan_Count,
    I tried changing the Count(...NULL) NULL to 0 or blank, but then it counts wrong (instead of counting just the settlements in that month it counts them all)

    how do I get it to add even if blank or null?

  2. #2
    Join Date
    Dec 2008
    Posts
    27
    hmm.. changed the sum iif settlements to return 0 instead of null
    seems to be working

  3. #3
    Join Date
    Jan 2009
    Location
    Portland, Oregon
    Posts
    21
    The NZ (Null to Zero) function is normally how you deal with nulls.

Posting Permissions

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