Results 1 to 6 of 6
  1. #1
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255

    Insert "0" for Null

    I have a crosstab query that shows some null fields that i would like to say 0.. Is there a formula or setting i can use to do this?



    I have:

    Div1- Row Heading
    Month- Column Heading
    Month- Count- Value

    Thanks..

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Look up the Nz() function.

  3. #3
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    Thanks rural.. I thought it was a bit more complicated than it actually was.. If
    you look at the Crosstab in the design grid the column being aggregated
    had "Count" in the Total Row and the name of the
    field being aggregated in the Field row. I changed the Total row to
    "Expression" and then change the Field row to Nz(Count(FieldName),0). I got zeros in the output instead of Nulls.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you want to go ahead and use the Thread Tools at the top of the thread ansd mark this thread as Solved?

  5. #5
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    New problem regarding this... I try to sum by row and it wont let me.. If I have 0, 1, 2, 2, 3 I get 1223 instead of 8... If I take out the NZ function then it wont even count the row, I guess due to the blank field.

  6. #6
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    got it...

    sum(...)+sum(...)...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-15-2011, 01:12 PM
  2. StrComp causing "Invalid use of Null" error
    By sephiroth2906 in forum Programming
    Replies: 5
    Last Post: 09-15-2011, 07:06 PM
  3. Update query from form "invalid use of null"
    By Lady_Jane in forum Programming
    Replies: 4
    Last Post: 08-16-2011, 01:37 PM
  4. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  5. Convert null to "" in Access
    By isaac_2004 in forum Access
    Replies: 1
    Last Post: 12-04-2009, 06:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums