Hi,
I have a lookup table that contains all of my PCPs. I also have the PCP's in another table.
I would like to see which PCP's do I have ofr the month of January 1-31 and which PCP does not appear in the lookup table, yet.
-We add them manually after finding them in the other table.-
Please take a look at my query so far:
SELECT DISTINCT Last(Cath_Extension.PCP) AS LastOfPCP, Event_Cath.Date_of_Cath, LU_ReferringMDList.ReferringMD
FROM LU_ReferringMDList LEFT JOIN (Cath_Extension INNER JOIN Event_Cath ON Cath_Extension.SS_Event_Cath_ID = Event_Cath.SS_Event_Cath_ID) ON LU_ReferringMDList.ReferringMD = Cath_Extension.PCP
GROUP BY Event_Cath.Date_of_Cath, LU_ReferringMDList.ReferringMD
HAVING (((Last(Cath_Extension.PCP)) Is Not Null) AND ((Event_Cath.Date_of_Cath) Between #1/1/2007# And #1/31/2007#))
ORDER BY Last(Cath_Extension.PCP), LU_ReferringMDList.ReferringMD;
Thank you!!!!!
I have a lookup table that contains all of my PCPs. I also have the PCP's in another table.
I would like to see which PCP's do I have ofr the month of January 1-31 and which PCP does not appear in the lookup table, yet.
-We add them manually after finding them in the other table.-
Please take a look at my query so far:
SELECT DISTINCT Last(Cath_Extension.PCP) AS LastOfPCP, Event_Cath.Date_of_Cath, LU_ReferringMDList.ReferringMD
FROM LU_ReferringMDList LEFT JOIN (Cath_Extension INNER JOIN Event_Cath ON Cath_Extension.SS_Event_Cath_ID = Event_Cath.SS_Event_Cath_ID) ON LU_ReferringMDList.ReferringMD = Cath_Extension.PCP
GROUP BY Event_Cath.Date_of_Cath, LU_ReferringMDList.ReferringMD
HAVING (((Last(Cath_Extension.PCP)) Is Not Null) AND ((Event_Cath.Date_of_Cath) Between #1/1/2007# And #1/31/2007#))
ORDER BY Last(Cath_Extension.PCP), LU_ReferringMDList.ReferringMD;
Thank you!!!!!