Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Crosstab Query (03)

    I have a crosstab query whose results return blank cells instead of zeros. Is it possible to have the blank cells return a zero?

    Example:
    <table border=1><td>Category</td><td>2005</td><td>2006</td><td>Apples</td><td>100</td><td> </td>
    <td>Oranges</td><td> </td><td>310</td>
    </table>

    Thanks,
    John

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crosstab Query (03)

    I found the solution while surfing the net:

    Field: IIF(Sum([Extended Price]) Is Null,0,Sum([Extended Price]))
    Table: <leave blank>
    Total: Expression
    CrossTab: Value

    John

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

    Re: Crosstab Query (03)

    You can also use the Nz function:

    Nz(Sum([ExtendedPrice]),0)

    The Nz function returns its first argument unless that is null, then it returns its second argument.

Posting Permissions

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