Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有三个约会:
25/10/2012, 01/01/2013, 26/12/2012.
25/10/2012
01/01/2013
26/12/2012
如何在 SQL Server 2008 中找到距当前日期最近的日期?
尝试这个!!
DECLARE @today DATE = '2013-10-25'; SELECT MAX(foo_date) AS prior_date FROM tables WHERE foo_date <= @today
那是你要的吗
select top 1 * from your_table order by abs(datediff(day, date_column, getdate()))