2015年7月11日 星期六

SQL smalldatetime or datetime抓當天

有時候資料庫欄位會開smalldatetime 或datetime
但是在select的時候程式若為區間那可能就會抓00:00~2359這樣下程式語法
datediff搭配只需輸入
select a.* 
from table as a
Where 
datediff(dy, a.xxx, '2015-07-10') = 0