2013-09-25 57 views
0

當tring獲取最大時間時,如何從查詢中刪除時間。SQL服務器:沒有TIMESTAMP的最長時間

Select (CONVERT(date,DATEADD(d,-7, GETDATE()) , 101)) as FromDate, max(Creation_Date) as ToDate 
from [UserRatings_all] 
WHERE ([UserID] = 'blah') 
group by userid 

給我:

FromDate ToDate 
2013-09-19 2013-09-21 02:27:34.000 

我需要丟棄TODATE

回答

0

只返回日期作爲字符串 CONVERT(CHAR(10),MAX(CREATION_DATE),101)