Posted on 2013-05-21
I am having trouble with a Query. Everything I try doesn't work. In short, it looks for a StudyID and if 955 = true but 985 or 986 are false, then I don't want it to show as a result. I am trying to get a list of studies that 955 is checked on a form, and 985 and 986 are not.
StudyID TypeCodeID Set1Flag
8621 955 -1
8621 985 -1
8621 986 0
Here is the SQL Statement. How can I get the result I desire?
SELECT dbo_HistoEvent.StudyID, dbo_HistoEvent.TypeCodeID, dbo_HistoEvent.Set1Flag
WHERE (((dbo_HistoEvent.StudyID)=8621) AND ((dbo_HistoEvent.TypeCodeID)=955)) OR (((dbo_HistoEvent.StudyID)=8621) AND ((dbo_HistoEvent.TypeCodeID)=985)) OR (((dbo_HistoEvent.StudyID)=8621) AND ((dbo_HistoEvent.TypeCodeID)=986));