Good Morning,
I am struggling with something I am sure should be easy but I just can't find a good way to deal with it. I have a table which lists appointments.
There is a CaseID, An Appointment Date and an Appointment ID (Other fields as well but these are the identifyers.) what I need to do is to run a report showing how many subsequent visits have been made. (A subsequent visit is any visit other than the first by CaseID)
So far I have "SELECT CaseID, Min(Appointment Date]) FROM tbl_Appointment s" this brings up the first appointment for each case, the problem is I want to also bring up the Appointment Number (So that in the next query I can use "Not IN (Select ApptNbr FROM qry_FirstAppt)" as the criteria for my second visits query but if I add the Appointment Number it groups by it and therefore returns each record.
I am sure there must be an easier way but at the moment I just can't get my head around it. Sorry if this is quite garbled but I have been trying what I thought would be a 10 minute query for two days now and it is hurting my head.
I am struggling with something I am sure should be easy but I just can't find a good way to deal with it. I have a table which lists appointments.
There is a CaseID, An Appointment Date and an Appointment ID (Other fields as well but these are the identifyers.) what I need to do is to run a report showing how many subsequent visits have been made. (A subsequent visit is any visit other than the first by CaseID)
So far I have "SELECT CaseID, Min(Appointment Date]) FROM tbl_Appointment s" this brings up the first appointment for each case, the problem is I want to also bring up the Appointment Number (So that in the next query I can use "Not IN (Select ApptNbr FROM qry_FirstAppt)" as the criteria for my second visits query but if I add the Appointment Number it groups by it and therefore returns each record.
I am sure there must be an easier way but at the moment I just can't get my head around it. Sorry if this is quite garbled but I have been trying what I thought would be a 10 minute query for two days now and it is hurting my head.
Comment