SQL Query Help: Pick a Random Employee of the Month
2 answers
select top 1 id from employee as emp
where not exist(
select top 1 *
from employeeofthemonth as em
where em.id = emp.id and dateadd(m, -6, getdate()) < monthendeddt )
order by newid()
... or something close to that. i didn't run sql but on mssql server it should be roughly correct.
+2
a source to share