really appreciate your help. This code was written 10 years ago....and i am a little new to coding.
SELECT DATEADD(mm, DATEDIFF(mm, 0, CONVERT(DATETIME, '20121130', 112)), 0) MonthStart ) CM
ON calldate >= DATEADD(mm, -1, MonthStart) AND calldate < MonthStart
Could you pseudo code explain what is happening in this block of code? what i thought it was doing was getting all data for this employee for the month i pass in(20121130). what the CM relates to is confusing me..