SQL Query = SELECT CONVERT(VARCHAR(10),GETDATE(),111)
Result=2011/10/13
SQL Query = SELECT DISTINCT CONVERT(VARCHAR(11),(date)) FROM user_log
Result=Oct 11 2011
SQL Query =SELECT Convert(char(2),DATEPART(hour, GETDATE())) + ':'+convert(char(2),datepart(mi,getdate())) + ':' + convert(char(2),datepart(s,getdate()))
Result=11:20:36
SQL Query = select substring(convert(varchar(20),date),12,8) as TheTime FROM user_log
Result=10:31PM
No comments:
Post a Comment