E
Emelina Bumsquash
I have a query as below and can't figure out what's wrong with it. It returns
only a '-1' if the conditions are true irrespective or how many cases it's
true in i.e. i made 2 records have the conditions of this query so it should
have returned '2' but it just returned '-1' ... can anyone help?
NB the Lost_FollowUp field is a yes/no checkbox - could that have something
to do with it?
SELECT Screened.Site,
(Sum(IIf([Consent]=1 And [ArmAllocated]=1 And [Violations_Dropouts]=2,1,0))
Or Sum(IIf([Consent]=1 And [ArmAllocated]=1 And [Violations_Dropouts]=1 And
[Lost_FollowUp]=-1,1,0))) AS [AC Chosen Withdrawal]
FROM (Recruitment INNER JOIN Randomisation ON Recruitment.StudyNumber =
Randomisation.StudyNumber) INNER JOIN Screened ON Recruitment.StudyNumber =
Screened.StudyNumber
GROUP BY Screened.Site;
only a '-1' if the conditions are true irrespective or how many cases it's
true in i.e. i made 2 records have the conditions of this query so it should
have returned '2' but it just returned '-1' ... can anyone help?
NB the Lost_FollowUp field is a yes/no checkbox - could that have something
to do with it?
SELECT Screened.Site,
(Sum(IIf([Consent]=1 And [ArmAllocated]=1 And [Violations_Dropouts]=2,1,0))
Or Sum(IIf([Consent]=1 And [ArmAllocated]=1 And [Violations_Dropouts]=1 And
[Lost_FollowUp]=-1,1,0))) AS [AC Chosen Withdrawal]
FROM (Recruitment INNER JOIN Randomisation ON Recruitment.StudyNumber =
Randomisation.StudyNumber) INNER JOIN Screened ON Recruitment.StudyNumber =
Screened.StudyNumber
GROUP BY Screened.Site;