親クエリによって生成されたテーブルの最後の列として、サブクエリによって生成された単一の列テーブルを結合する必要があります。
SELECT tn.teamtext, sum(case when CONVERT(smalldatetime,dModLast,101) BETWEEN '2012-03-01' AND '2012-03-10' then 1 else 0 end) AS cnt,
(SELECT sum(case when CONVERT(smalldatetime,dModLast,101) BETWEEN '2012-03-01' AND '2012-03-10' then 1 else 0 end)
FROM teamnames AS tn
JOIN caseaudit AS ca
ON tn.teamID = ca.referteamID2
WHERE ca.referteamid1 <> ca.referteamid2
AND isactive = 1
AND groupid = 18
AND accountid = 2) AS cnt2
FROM teamnames AS tn
JOIN caseaudit AS ca
ON tn.teamID = ca.referteamID2
WHERE ca.referteamid1 <= 0
AND ca.referteamid1 <> ca.referteamid2
AND isactive = 1
AND groupid = 18
AND accountid = 2
GROUP BY tn.teamtext
ORDER BY tn.teamtext
私に与える:
4H BOSS 55 430
4H BSG 0 430
4H SALES AND MKTG 0 430
ACCOUNTS RECEIVABLE 0 430
ASSET MANAGEMENT 9 430
AUDIT 0 430
BOSS 4 430
CORPORATE BSG 0 430
CUSTOMER SUPPORT 87 430
NETWORK ENGINEERING 11 430
PRODUCTION ENGINEERING 116 430
PRODUCTION OPERATIONS 0 430
SECURITY 2 430
SNFAL PRODUCT TEAM 0 430
VOICE SERVICES 18 430
XEROX 4 430
「430」は100%正しくありません。