Record Counting

  • Thread starter Thread starter Kelly
  • Start date Start date
K

Kelly

In my "Date Footer" I have the following

Bag Changes for the Month =Count(*)+Sum([Expr1])

In my "Report Footer" I have the same entry. This works
fine as it picks up all of the bag changes YTD. My problem
is that I need a way for "Bag Changes for the Month" to
show the record count when there are no entries in the
[Expr1] field.

Example1:

Date RowNumber SectorNumber
12/12/03 02 01
12/12/03 05 ALL

Total Bag Changes for the Month 11 (This works well)

Example2:

Date RowNumber SectorNumber
12/11/03 02 01

Total Bag Changes for the Month 1 (This will not show on
the report but is included in the YTD totals in
the "Report Footer" which would show 12).Any help would be
appreciated. Thanks...kbe
 
I can't make out what your "Expr1" field is by what you have here. However,
an IIf or Nz statement will usually fix the problem. If the value is Null,
the Nz will work

Bag Changes for the Month =Count(*)+Nz(Sum([Expr1]), ValueIfNull)

otherwise, use the IIf to test for other possibilities

Bag Changes for the Month =Count(*)+IIf([Expr1]="", ValueIfTrue,
Sum([Expr1]))

--
Wayne Morgan
Microsoft Access MVP


Kelly said:
In my "Date Footer" I have the following

Bag Changes for the Month =Count(*)+Sum([Expr1])

In my "Report Footer" I have the same entry. This works
fine as it picks up all of the bag changes YTD. My problem
is that I need a way for "Bag Changes for the Month" to
show the record count when there are no entries in the
[Expr1] field.

Example1:

Date RowNumber SectorNumber
12/12/03 02 01
12/12/03 05 ALL

Total Bag Changes for the Month 11 (This works well)

Example2:

Date RowNumber SectorNumber
12/11/03 02 01

Total Bag Changes for the Month 1 (This will not show on
the report but is included in the YTD totals in
the "Report Footer" which would show 12).Any help would be
appreciated. Thanks...kbe
 
Thank you very much, the problem is solved. Have a good
holiday season and a prosperous New Year...kbe
-----Original Message-----
I can't make out what your "Expr1" field is by what you have here. However,
an IIf or Nz statement will usually fix the problem. If the value is Null,
the Nz will work

Bag Changes for the Month =Count(*)+Nz(Sum([Expr1]), ValueIfNull)

otherwise, use the IIf to test for other possibilities

Bag Changes for the Month =Count(*)+IIf([Expr1]="", ValueIfTrue,
Sum([Expr1]))

--
Wayne Morgan
Microsoft Access MVP


In my "Date Footer" I have the following

Bag Changes for the Month =Count(*)+Sum([Expr1])

In my "Report Footer" I have the same entry. This works
fine as it picks up all of the bag changes YTD. My problem
is that I need a way for "Bag Changes for the Month" to
show the record count when there are no entries in the
[Expr1] field.

Example1:

Date RowNumber SectorNumber
12/12/03 02 01
12/12/03 05 ALL

Total Bag Changes for the Month 11 (This works well)

Example2:

Date RowNumber SectorNumber
12/11/03 02 01

Total Bag Changes for the Month 1 (This will not show on
the report but is included in the YTD totals in
the "Report Footer" which would show 12).Any help would be
appreciated. Thanks...kbe


.
 
Back
Top