9 回答
TA贡献1796条经验 获得超10个赞
select e.emp_no,e.emp_cname,e.emp_ename,e.dept_code,b.[name], ISNULL(convert(nvarchar(20),EventsDateTime,120),'') cardtime
from [benq].Sky2004.dbo.AccessEvents a,employee [benq].Sky2004.dbo.VIEW_DeviceReader b
where
a.personno not exists (select 1 from employee c where c.dept_code='2000' and c.active='Y') AND (convert(nvarchar(20),EventsDateTime,112) BETWEEN '2012-08-01' AND '2012-08-21') and e.active='Y' and b.[name] like '%考勤%'
and a.deviceid=b.recnum
and a.personno=e.emp_no
order by convert(nvarchar(10),EventsDateTime,112) desc,e.emp_no,EventsDateTime
TA贡献1875条经验 获得超3个赞
@MikeAndy:
再试下
select e.emp_no,e.emp_cname,e.emp_ename,e.dept_code,b.[name],ISNULL(convert(nvarchar(20),EventsDateTime,120),'') cardtime
from [benq].Sky2004.dbo.AccessEvents a,employee [benq].Sky2004.dbo.VIEW_DeviceReader b
where
a.personno exists (select c.personno from employee c where c.dept_code='2000' and c.active='Y')
AND (convert(nvarchar(20),EventsDateTime,112) BETWEEN '2012-08-01' AND '2012-08-21') and e.active='Y' and b.[name] like '%考勤%'
and a.deviceid=b.recnum
and a.personno=e.emp_no
order by convert(nvarchar(10),EventsDateTime,112) desc,e.emp_no,EventsDateTime
- 9 回答
- 0 关注
- 754 浏览
添加回答
举报