Select CorpID,
Convert(VarChar(2),Month(E.BeginDate)) + '/' + Convert(VarChar(4),Year(E.BeginDate)),
Count(Year(e.BeginDate)) As 'total Screen'
--Count(Month(E.CurrentBeginDate))
From dbo.NonCalls E
Where E.BeginDate between {d'2013-01-01'} and {d'2013-12-31'}
Group By CorpID, Year(E.BeginDate),Month(E.BeginDate)
Union ALL
Select CorpID,
Convert(VarChar(2),Month(E.CurrentBeginDate)) + '/' + Convert(VarChar(4),Year(E.CurrentBeginDate)),
Count(Year(e.CurrentBeginDate)) As 'total Screen'
--Count(Month(E.CurrentBeginDate))
From dbo.Employee E
Where E.CurrentBeginDate between {d'2013-01-01'} and {d'2013-12-31'}
Group By CorpID, Year(E.CurrentBeginDate),Month(E.CurrentBeginDate)
--Order By CorpID, Year(E.CurrentBeginDate), Month(E.CurrentBeginDate)
I change my code to this and now I get the numbers that i was looking for the only problem is that it's not sorted i need it to sorted by Corpid and then by date 01-02-03 etc I'm not quite sure
how to get that accomplish any help would be greatly apreciated.