G
Guest
SELECT DSM.MajorDep, Psychotropic.Prescribed, Safety.SafetyRisk, Info.ResId,
Info.TodaysDate
FROM ((Info INNER JOIN DSM ON (Info.ResId = DSM.ResId) AND (Info.TodaysDate
= DSM.DSMDate)) INNER JOIN Psychotropic ON (Info.ResId = Psychotropic.ResId)
AND (Info.TodaysDate = Psychotropic.PsychotropicDate)) INNER JOIN Safety ON
(Info.ResId = Safety.ResId) AND (Info.TodaysDate = Safety.SafetyDate)
WHERE (((Safety.SafetyRisk)=1) AND ((Info.ResId)=[whichId]) AND
((Info.TodaysDate)=Date())) OR (((Psychotropic.Prescribed)=1)) OR
(((DSM.MajorDep)=1));
I have in my tables like this
ResId =4, SafetyRisk = 1, Prescribed = 0, and MajDep = 0
ResId =2, SafetyRisk = 1, Prescribed = 0, and MajDep = 1
and I put in 4 the ResId
the query is pulling
ResId =4, SafetyRisk = 1, Prescribed = 0, and MajDep = 1
So basicly it is taking MajDep value from ResId = 2 and pulling it into this
query.
It should be 0 from the ResId = 4.
Does anyone have any ideas?
Info.TodaysDate
FROM ((Info INNER JOIN DSM ON (Info.ResId = DSM.ResId) AND (Info.TodaysDate
= DSM.DSMDate)) INNER JOIN Psychotropic ON (Info.ResId = Psychotropic.ResId)
AND (Info.TodaysDate = Psychotropic.PsychotropicDate)) INNER JOIN Safety ON
(Info.ResId = Safety.ResId) AND (Info.TodaysDate = Safety.SafetyDate)
WHERE (((Safety.SafetyRisk)=1) AND ((Info.ResId)=[whichId]) AND
((Info.TodaysDate)=Date())) OR (((Psychotropic.Prescribed)=1)) OR
(((DSM.MajorDep)=1));
I have in my tables like this
ResId =4, SafetyRisk = 1, Prescribed = 0, and MajDep = 0
ResId =2, SafetyRisk = 1, Prescribed = 0, and MajDep = 1
and I put in 4 the ResId
the query is pulling
ResId =4, SafetyRisk = 1, Prescribed = 0, and MajDep = 1
So basicly it is taking MajDep value from ResId = 2 and pulling it into this
query.
It should be 0 from the ResId = 4.
Does anyone have any ideas?