如何从有日期和时间的表中获取日期部分ex:-2012-12-20 00:00:00.000 [英] how to get date part only from table where there was date and time ex:-2012-12-20 00:00:00.000
本文介绍了如何从有日期和时间的表中获取日期部分ex:-2012-12-20 00:00:00.000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从有日期和时间的表中获取日期部分ex:-2012-12-20 00:00:00.000
i只想2012-12-20而不是2012-12 -20 00:00:00.000
how to get date part only from table where there was date and time ex:-2012-12-20 00:00:00.000
i want only 2012-12-20 instead of 2012-12-20 00:00:00.000
推荐答案
这种方式......
this way...
select replace(convert(varchar(10),getdate(),102),'.','/')
函数转换
转换(转换为类型
, datefield
, Dateformat_to_apply
)
快乐编码!
:)
function convert
convert( convert into type
, datefield
, Dateformat_to_apply
)
Happy Coding!
:)
这篇关于如何从有日期和时间的表中获取日期部分ex:-2012-12-20 00:00:00.000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文