G
Guest
I have this query:
SELECT DSM.MajorDep, Psychotropic.Prescribed
FROM (Info INNER JOIN DSM ON (Info.TodaysDate = DSM.DSMDate) AND (Info.ResId
= DSM.ResId)) INNER JOIN Psychotropic ON (Info.TodaysDate =
Psychotropic.PsychotropicDate) AND (Info.ResId = Psychotropic.ResId)
GROUP BY DSM.MajorDep, Psychotropic.Prescribed, Info.ResId, Info.TodaysDate
HAVING (((DSM.MajorDep)=1) AND ((Info.ResId)=[whichId]) AND
((Info.TodaysDate)=Date())) OR (((Psychotropic.Prescribed)=1));
Sometimes MajorDep in the table DSM will not have any record in the table.
But when I run this query and the MajorDep is not in the table it is pulling
up another record instead.
So If i enter 10 for the ResId and have no 10 ResId corresponding to the
Date() I would like the query to come up with no records in it. But it is
actually pulling another record with a completely different ResId's MajorDep
so the query has 1 record in it. Does this make sense? Did I miss something?
SELECT DSM.MajorDep, Psychotropic.Prescribed
FROM (Info INNER JOIN DSM ON (Info.TodaysDate = DSM.DSMDate) AND (Info.ResId
= DSM.ResId)) INNER JOIN Psychotropic ON (Info.TodaysDate =
Psychotropic.PsychotropicDate) AND (Info.ResId = Psychotropic.ResId)
GROUP BY DSM.MajorDep, Psychotropic.Prescribed, Info.ResId, Info.TodaysDate
HAVING (((DSM.MajorDep)=1) AND ((Info.ResId)=[whichId]) AND
((Info.TodaysDate)=Date())) OR (((Psychotropic.Prescribed)=1));
Sometimes MajorDep in the table DSM will not have any record in the table.
But when I run this query and the MajorDep is not in the table it is pulling
up another record instead.
So If i enter 10 for the ResId and have no 10 ResId corresponding to the
Date() I would like the query to come up with no records in it. But it is
actually pulling another record with a completely different ResId's MajorDep
so the query has 1 record in it. Does this make sense? Did I miss something?