• Nulls in Crosstab queries (Access 97)

    Author
    Topic
    #383012

    I have a crosstab query which has a row header of dates, and column headers of various types of goods, and a value of goods booked out. Some dates don’t have goods within a column header booked out, so I get a Null. I have tried various ways of getting the Value within the crosstab to display 0, instead of Null without success. When I try to add columns later, where there is a null value in one column field, I get an overall Null despite the fact that one of the fields has a value ….. can anyone help??
    Regards and thanks. brainwash

    Viewing 0 reply threads
    Author
    Replies
    • #651525

      You can use the Nz function to substitute a 0 for null values: in the query design grid, use Nz([Fieldname],0) instead of [Fieldname].

      Does this solve your second problem too? If not, how are you adding columns?

      • #651560

        Hello Hans, how are you? Thanks for your reply. Had tried NZ in the value column with no success, but have now found another way to get to the data I was wanting. I’m not sure why NZ doesn’t seem to work in crosstab queries…. Many thanks for your help as always.

        M

        • #651565

          Marion,

          Since you already found another solution, this is just for the record – perhaps someone else will be able to use this. Nz *does* work in crosstab queries, but in a slightly different way. Enter an expression in the field of the form

          V: Nz(Sum([FieldName]),0)

          and set the Totals option to Expression.

          Have a good weekend.

    Viewing 0 reply threads
    Reply To: Nulls in Crosstab queries (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: