WHERE datediff( d,getdate(),my_date) > 0 -- 取得my_date是今天以後的資料
WHERE datediff( d,my_date,getdate()) = 1 -- 取得my_date是昨天的資料
- Dec 27 Thu 2012 15:39
-
[SQL] 和今天的比較
WHERE datediff( d,getdate(),my_date) > 0 -- 取得my_date是今天以後的資料
WHERE datediff( d,my_date,getdate()) = 1 -- 取得my_date是昨天的資料
請先 登入 以發表留言。