I have a query with the following fields:
[Clinic] [Month] [Year] [NewPatients]
Some of the calculations I would like to do are based on the number of new patients that a certain clinic received in the previous month. Does anyone have any suggestions on how I can create a field that has the number of new patients from the previous month?
What I have is this:
PrevMonth: DLookUp("[NewPatients]","ClinicQuery","[Month] = " & [Month]-1)
What I can't figure out is how to account for the fact that I have multiple clinics in the [Clinic] field and each clinic has multiple years in which it was receiving new patients. The PrevMonth statement above works fine for the first clinic listed in the query during the first year it received patients (entries are sorted by month and year), but then just repeats these data for each subsequent year and clinic. Any ideas?
Thanks in advance for any advice!
[Clinic] [Month] [Year] [NewPatients]
Some of the calculations I would like to do are based on the number of new patients that a certain clinic received in the previous month. Does anyone have any suggestions on how I can create a field that has the number of new patients from the previous month?
What I have is this:
PrevMonth: DLookUp("[NewPatients]","ClinicQuery","[Month] = " & [Month]-1)
What I can't figure out is how to account for the fact that I have multiple clinics in the [Clinic] field and each clinic has multiple years in which it was receiving new patients. The PrevMonth statement above works fine for the first clinic listed in the query during the first year it received patients (entries are sorted by month and year), but then just repeats these data for each subsequent year and clinic. Any ideas?
Thanks in advance for any advice!