select * from (Select * from [School] where [BoroughID]=19 and [CurrentAccreditationTypeID]=2)st join (select * from(select distinct [SchoolID] from [Survey] where [SurveyDate]>='2014-01-09 00:00:00:000' and [SurveyDate]<='2015-31-08 00:00:00:000')as [ID], [SurveyID]) s on st.[SchoolID]= s.[SchoolID]
select * from (Select * from [School] where [BoroughID]=19 and [CurrentAccreditationTypeID]=2)st join (select distinct [SchoolID] from [Survey] where [SurveyDate]>='2014-01-09 00:00:00:000' and [SurveyDate]<='2015-31-08 00:00:00:000') s on st.[SchoolID]= s.[SchoolID]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)