读书人

在线急等大侠们进来看看吧!日期有关

发布时间: 2013-08-01 15:23:18 作者: rapoo

在线急等,大侠们进来看看吧!日期问题!
表 activity 有 guid, address ,activityDate(会议时间),joinperson(参加人员) 字段

有这样的需求:活动(activityDate)前一天,系统自动向参加人员发短信!

我想用 sql 语句查出 是活动前一天的数据!!!
[解决办法]

select datediff(dd,-1,activityDate) from activity    --???
--活动前一天?

[解决办法]


--当前日期=会议日期 - 一天
select *
from Activity
where convert(varchar(10),getdate(),121) =CONVERT(varchar(10),datediff(dd,-1,activityDate),121)

读书人网 >SQL Server

热点推荐