I have a bit of a problem with a field on one of my reports.
I have created a report to provide Totals figures for various pieces of information relating to drug prescriptions in my datatabase.
All of the textboxes used in the report appear in the report footer as I am looking at totals information rahter than individual records.
I need to return the maximum and minimum doasge values for the records in the recordsource. The maximum values work fine using the following code in the Control Source of the text box:
=Max(IIf([Area]="NameofArea",[Mgs1],0))
Where Mgs1 is the fields containing the dosage value.
I then used the following code for the minimum value:
=Min(IIf([Area]="NameofArea",[Mgs1],0))
The problem with this is that it returns values of zero and what I actually need is the lowest value that is not zero. I then tried the following code but it made no difference:
=Min(IIf([Area]="NameofArea" And [Mgs1]>0,[Mgs1],0))
Can anyone see what I'm doing wrong?
I have created a report to provide Totals figures for various pieces of information relating to drug prescriptions in my datatabase.
All of the textboxes used in the report appear in the report footer as I am looking at totals information rahter than individual records.
I need to return the maximum and minimum doasge values for the records in the recordsource. The maximum values work fine using the following code in the Control Source of the text box:
=Max(IIf([Area]="NameofArea",[Mgs1],0))
Where Mgs1 is the fields containing the dosage value.
I then used the following code for the minimum value:
=Min(IIf([Area]="NameofArea",[Mgs1],0))
The problem with this is that it returns values of zero and what I actually need is the lowest value that is not zero. I then tried the following code but it made no difference:
=Min(IIf([Area]="NameofArea" And [Mgs1]>0,[Mgs1],0))
Can anyone see what I'm doing wrong?