This is a migrated thread and some comments may be shown as answers.

Count Expression problem

1 Answer 513 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
akpaga akpaga
Top achievements
Rank 1
akpaga akpaga asked on 09 May 2012, 10:15 PM
Hi ,

I am using the following function to count the number of CUstomers who are Of type Daily.
=Count(IIf(Fields.CustomerType = 'Daily', 1, null))

I am using this in the expression field of a Textbox...But the problem is that the count is diffreneting from the count in the database by 1 record... say if i am getting 94 records in sql databse the count in the report is 93 ...This happening for all types..Am i doing anything Wrong..Thank you

PS: i  am using a table wizard to generate my rows and then in order to show the count i am doing the following

Insert rows->Outsie the group-below-- and here in this row i am  using the count function..

Does this make any difference...

1 Answer, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 10 May 2012, 08:34 AM
The count function returns a count of the non-null values, so if Fields.CustomerType <> 'Daily' you would get a null value that would not be included in the count. You can replace the null with 0.

Cheers!
Tags
General Discussions
Asked by
akpaga akpaga
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Share this question
or