If I understand your question properly, I think this might work. It worked on your supplied sample data. :)
SET @StartDate = '2015-01-01';
SET @EndDate = '2015-01-02';
SET @NumDays = DATEDIFF(@EndDate,@StartDate)+1;
SELECT a.*
FROM anandtest a,
(SELECT EMPID, COUNT(EMPID) AS TheCount...