I want date instead of datetime from my table in sql server?
本问题已经有最佳答案,请猛点这里访问。
我有一张桌子,里面有一列,
1 2 | SELECT CAST(enteredDateTime AS DATE) FROM mytable |
试试这个:
1 | SELECT CAST(yourDateTimeColumn AS DATE) from tableName |
例如
1 | SELECT CAST(GETDATE() AS DATE) |
给我
1 | 2014-07-09 |
请参阅:http://www.w3schools.com/sql/sql_dates.asp
1 2 | Select Convert(Date, EnteredDateTime) as EnteredDateTime From TableName |
看看演员阵容和转换