Help with IIf statement

Fisher

Registered User.
Local time
Today, 05:40
Joined
Dec 17, 2003
Messages
28
Hello,
I'm having trouble trying to adjust a report in which I use IIf statements.
I have a database that tracks all the major joint replacement surgeries done. (Total hip replacment, total knee replacement, etc.) In my report, the various surgeries are total for a defined time period which is determined through a calendar control on a form.

=Sum(IIf([Surgery]="Total Hip Replacement" And [AdmDate] Between [Forms]![DateRangeMonthlyRehabfrm]![DateRangeCalendar1] And [Forms]![DateRangeMonthlyRehabfrm]![DateRangeCalendar2],1))

My problem is that we have now separated out the revision surgeries, (Total hip revision, etc.), but i still want to total them together. I have searched here on nested IIF statements but, I can't seem to get it right. I want a total number of all surgeries that are "Total Hip Replacement" OR "Total Hip Revision" and the admit date (AdmDate) is within the selected date range.

Any help would be greatly appreciated.
 
Thanks very much Pat. I seem to be always trying to make things too difficult. I struggled a lot with it. When you pointed out the And before Or rule (which I did not know) it became very clear.
Thanks again.
 

Users who are viewing this thread

Back
Top Bottom