1. Account<br /> 2. Closed Account
SELECT distinct vwA.AccountID,vwA.AccountName FROM vwAccounts vwA inner JOIN RMT_RiskAssessmentPlan AP ON AP.Accountcode = VWA.AccountID WHERE AP.[Year] = 2013 AND VWA.AccountID NOT IN (SELECT AccountCode FROM RMT_ClosedAccount WHERE [YEAR] = 2013) order by vwA.AccountName
SELECT distinct vwA.AccountID,vwA.AccountName FROM vwAccounts vwA inner JOIN RMT_RiskAssessmentPlan AP ON AP.Accountcode = VWA.AccountID WHERE AP.[Year] = 2013 AND not exists(SELECT AccountCode FROM RMT_ClosedAccount WHERE [YEAR] = 2013) order by vwA.AccountName
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)