Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

dcCount on Null Values

edited June 2003 in General
Hello,

dcCount is counting the number of records regardless if the field
I selected to dcCount is null.

I have 2 tables that are joined together. If the second table doesn't have
any records
I still show the first but do not want to increment the counter. I selected
a field
from the second table thinking that when it found a field with a null value
it would not increment. The way it is currently working it doesn't seem to
matter
which field I select since it's a record counter not a valid field counter.
Is there
any way to change this.

Any help would be greatly appreciated.

Thanks

Bill

Comments

  • edited June 2003
    Hi Bill,

    Instead of using a TppDBCalc component to calculate the count, try using a
    variable that pulls the value directly off of the dataset. Then, inside the
    Variable's OnCalc event, you can check for a null value and only print the
    values you need.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2003
    You can test for a null field value by using the IsNull function on the
    field object returned by the pipeline.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2003
    Thanks for the reply Nico. I was able to use your suggestion as a work
    around by using a variable's OnCalc event and check if the value is null.
    If it is not null I incremented a global counter. At the end of the report
    in the summary section I used another Variable's OnCalc script to print
    the global counter. Not really the way I wanted to do it but it works okay.

This discussion has been closed.