Leo的備忘錄
顯示具有
SQL Server
標籤的文章。
顯示所有文章
顯示具有
SQL Server
標籤的文章。
顯示所有文章
2011年2月26日 星期六
取出當日日期之SQL語法
1.Oracle
Select trunc(sysdate) from dual
2.SQL Server
(1)先轉成Varchar再轉回Datetime
Case(Convert(VARCHAR, getdate(),101) as datetime)
(2)先轉成浮點數後取整數位,再轉回Datetime
Case(Floor(Cast(getdate() as float)) as datetime)
首頁
訂閱:
文章 (Atom)