select * 
from employee  
where id not in(select id from cowa)
 and id not in(select id from cowa where stuff(convert varchar(20),date,120),1,10,'')='2005-10-15')

解决方案 »

  1.   

    select * from employee  where id not in(select id from cowa)select * from employee a where a.id  in (select id from cowa where Date between 时间1 and 时间2)
      

  2.   

    查询考勤表中没有的员工信息
    select * from employee where id not in (select id from COWA )
    查询考勤表中2005-10-15早上没到的员工信息
    select * from employee where id not in (select id from COWA where datediff(dd,date,'2005-10-15')=0)
      

  3.   

    查询考勤表中2005-10-15早上没到的员工信息
    select * from employee where id not in (select id from COWA where datediff(dd,date,'2005-10-15')=0 and datediff(hh,date,'2005-10-15 12:00:00')>=0)