62,272
社区成员
发帖
与我相关
我的任务
分享
-- 在oracle中有如下方法
select * from talbe where to_date(MyDateTime,'yyyy/MM/dd') < '2010/02/18'
-- sql server不知道有没有类似的方法,请上网查一下吧,主要用到了to_date(),不知道SQL server里有没有
declare @dt as datetime
set @dt = getdate() --输入指定日期
select *
from TableName
where datediff(d,MyDateTime,@dt)>0
select * from 表名 where Cast(MyDateTime As DateTime )<getdate()

select * from 表名 where MyDateTime < '2007-1-1'
go