用DateDiff函数这个函数SQL Server也有的
sql="select lname+fname as 人员,cardno as卡号,logdevadescrp
as 地点,evnt_dat as 时间 from ev_log where DateDiff(day,evnt_dat,getdate())=0 and
comp_name is not null order by evnt_dat desc "
DateDiff参考文档
http://www.
原理就是比较两个日期相差几天如果是当天的数据则两个日期相差0天