一个SQL语句的问题? 谢过各位了!!!(0分)

  • 主题发起人 主题发起人 kit
  • 开始时间 开始时间
K

kit

Unregistered / Unconfirmed
GUEST, unregistred user!
在SQL Server 中怎么将字符函数转换成时间格式?
比如在ORACLE中有数据转换函数:
to_date(''' + FormatDateTime('yyyy-mm-dd',date) + ''',''yyyy-mm-dd''))
 
使用 CAST:
CAST ( expression AS data_type )
使用 CONVERT:
CONVERT (data_type[(length)], expression [, style])
 
Here is an example in MS Server, 103 is of the British standard, and this field
can be set as you want:

SELECT CONVERT(DATETIME,'24/07/1991',103)

The output is:
--******
1991-07-24 00:00:00.000
(1 row(s) affected)
 
接受答案了.
 
后退
顶部