If you want to get the highest entered records (transactions) in the current month you may write the query below select top 1 CourseID,count(*) as forms from dataform where month(DataFormDate)=MONTH(GETDATE()) group by CourseID order by forms desc when you want more than one records change the top 1 to the desired numbered.