如何更改日期格式。 [英] How to change date format.

查看:70
本文介绍了如何更改日期格式。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将日期格式更改为DD / MM / YYYY。还有一件事是,如何将整数值更改为日期格式。



喜欢 - 输入:11122014

输出:12-NOV -2014

I want to change date format into DD/MM/YYYY. And One more thing is that, how to change integer value into date format.

Like - input : 11122014
output : 12-NOV-2014

推荐答案

您好,



请参考以下日期格式化的链接描述。

日期格式化在Sql



谢谢

Sisir Patro
Hi,

Please refer the following link where the formating of the date is wel described.
Date Formatting in Sql

Thanks
Sisir Patro


我建​​议使用 to_date() [ ^ ]和 to_char( ) [ ^ ]功能获取适当的日期:



I'd suggest to use to_date()[^] and to_char()[^] functions to get proper date:

SELECT to_date(to_char(11122014), 'dd/mm/yyyy') As MyDate


您好,

请尝试以下方法:



Hi,
Try this following :

select convert(varchar(11), cast(yourDate as date), 106) from Table





谢谢



thanks


这篇关于如何更改日期格式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆