Max and Min will not display correctly

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.
 
M

Marshall Barton

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.
 
C

Clifford Bass

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top