MS SQL Server中的CONVERT日期格式化大全
来源:互联网 发布:淘宝评价 编辑:程序博客网 时间:2024/05/18 03:51
CONVERT
将某种数据类型的表达式显式转换为另一种数据类型。由于某些需求经常用到取日期格式的不同.现以下可在
SQL Server中 将日期格式化.
使用 CONVERT:
CONVERT (data_type[(length)], expression [, style])
select CONVERT(varchar, getdate(), 120 )
2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),/'-/',/'/'),/' /',/'/'),/':/',/'/')
20040912110608
select CONVERT(varchar(12) , getdate(), 111 )
2004/09/12
select CONVERT(varchar(12) , getdate(), 112 )
20040912
select CONVERT(varchar(12) , getdate(), 102 )
2004.09.12
select CONVERT(varchar(12) , getdate(), 101 )
09/12/2004
select CONVERT(varchar(12) , getdate(), 103 )
12/09/2004
select CONVERT(varchar(12) , getdate(), 104 )
12.09.2004
select CONVERT(varchar(12) , getdate(), 105 )
12-09-2004
select CONVERT(varchar(12) , getdate(), 106 )
12 09 2004
select CONVERT(varchar(12) , getdate(), 107 )
09 12, 2004
select CONVERT(varchar(12) , getdate(), 108 )
11:06:08
select CONVERT(varchar(12) , getdate(), 109 )
09 12 2004 1
select CONVERT(varchar(12) , getdate(), 110 )
09-12-2004
select CONVERT(varchar(12) , getdate(), 113 )
12 09 2004 1
select CONVERT(varchar(12) , getdate(), 114 )
11:06:08.177
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的 CONVERT 日期时间 格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的CONVERT日期格式化大全
- sql server中的convert日期格式化大全
- SQL Server中的CONVERT日期格式化大全
- MS SQL Server中的日期格式化大全
- MS SQL Server中的日期格式化大全
- MS SQL Server中的日期格式化大全
- MS SQL Server中的日期格式化大全
- MS SQL Server中 CONVERT日期格式化
- 以一个最简单的例子把OO的JavaScript说明白
- DataGrid输出到Excel并进行格式化处理
- BOM 的一些总结(2)
- 怎样有选择的读取XML中的各结点数据
- Netflow(FreeBSD)
- MS SQL Server中的CONVERT日期格式化大全
- C++之父B. Stroustrup的近期言论
- 自定义控件的服务器端事件
- 简单的工厂模式
- ASP.NET2.0中创建基于XML应用程序(1)
- Global Mapper 8 中地图投影的设置
- pclint
- 2.13阴
- SAP简史