SELECT
country,
COUNT(CASE
WHEN entrydate >= '2001-01-01' AND entrydate < '2013-08-01'AND valid<>1
THEN entrydate
ELSE NULL
END) AS [NV] ,
COUNT(CASE
WHEN entrydate >= '2001-06-01' AND entrydate < '2013-08-01'
THEN entrydate
ELSE NULL
END) AS [RC]
FROM candidate_details
GROUP BY country
--Second Solution
SELECT
country,
CAST(
COUNT(CASE
WHEN entrydate >= '2001-01-01' AND entrydate < '2013-08-01'AND valid<>1
THEN entrydate
ELSE NULL
END) AS VarCHAR(3)) + '|' +
CAST(
COUNT(CASE
WHEN entrydate >= '2001-06-01' AND entrydate < '2013-08-01'
THEN entrydate
ELSE NULL
END) AS VarCHAR(3)) 'NV/RC'
FROM candidate_details
GROUP BY country