Max and Min will not display correctly

  • Thread starter Thread starter Coach K
  • Start date Start date
C

Coach K

I have a DB that calculcates the dates between a start date and end date.
Sometime the dates a completed or enter. I my report i get zero's i have done
IIF function to add a double dash in those fields. Then when i run the report
the Max and Min function never displays the correct high or low number of
date. here is the control source for the unbound:
=Min(IIf([field name]<>'--',[field name]))
the same for Max function.

Your help is greatly needed.
 
Coach said:
I have a DB that calculcates the dates between a start date and end date.
Sometime the dates a completed or enter. I my report i get zero's i have done
IIF function to add a double dash in those fields. Then when i run the report
the Max and Min function never displays the correct high or low number of
date. here is the control source for the unbound:
=Min(IIf([field name]<>'--',[field name]))
the same for Max function.


The aggregate functions (Count, Sum, Min, Max, etc) only
operate on fields in the record source table/query. They
are unaware of controls in the form/report.
 
Hi Coach K,

Is [field name] a field in your table? A calculated field in your
report's query? or defined only on the report? What precisely is in [field
name]? A number of days? You might try something like this:

=Min(IIf(IsNull([Start Date]) Or IsNull([End Date]), Null, DateDiff("d",
[Start Date], [End Date]))

Clifford Bass
 
Back
Top