Hi, i have two tables employee and timesheet-
employee contains-employeeid,employeename
timesheet contains-employeeid,startdate,enddate,hourstaken
user enter multiple records on a same day.
now i want which employees hourstaken is less then n hours.
suppose i want date-01/03/2012 and hourstaken = 5hr
so i want how many employees are not working atleast 5 hr on a 01/03/2012
In a result i want -
employeename,startdate,hourstaken
i am using this querry it gives employeeid i want employeename instead of employeeid
select convert(VARCHAR, '2012/02/18', 111) as startdate, sum(hourstaken) as hourstaken,employeeid
from timesheet where convert(VARCHAR, startdate, 111) = '2012/02/18'
group by employeeid having sum(hourstaken) < '5'
Thanks