社区
MS-SQL Server
帖子详情
datatime change to char?
fishone
2002-11-13 11:15:12
how to change datatime to char type?
...全文
30
13
打赏
收藏
datatime change to char?
how to change datatime to char type?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
13 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
firedragoninhell
2002-11-18
打赏
举报
回复
select convert(char(4),year(getdate())) + '-' + convert(varchar(2),month(getdate())) + '-' + convert(varchar(2),day(getdate()))
twht
2002-11-14
打赏
举报
回复
用datename(mm,getdate())出来的是月份的英文缩写,我想要数字。
完成这个功能,使用这个语句,得到的就是数字:
MONTH(GETDATE())
流星尔
2002-11-13
打赏
举报
回复
select convert(char(10),getdate(),120)
fishone
2002-11-13
打赏
举报
回复
而且是mm型,如9月,出来的应该是09,请大侠指教。
fishone
2002-11-13
打赏
举报
回复
用datename(mm,getdate())出来的是月份的英文缩写,我想要数字。
senzz
2002-11-13
打赏
举报
回复
convert cast都可以
lbd8848
2002-11-13
打赏
举报
回复
datename(yy,getdate()) + datename(mm,getdate()) + datename(dd,getdate())
CrazyFor
2002-11-13
打赏
举报
回复
convert cast都可以
Chiff
2002-11-13
打赏
举报
回复
联机帮助convert
奇遇
2002-11-13
打赏
举报
回复
suppose col1 is datetime column,
U can use convert(char(20),col1,120)
fishone
2002-11-13
打赏
举报
回复
用datapart取出int型数据时,就已经变成了一位,在转换成char型还是一位。
wengj
2002-11-13
打赏
举报
回复
先用DatePart取出相应的年月日等int型数据,然后在转化成需要的格式。
fishone
2002-11-13
打赏
举报
回复
由于机器的区域设置不同,datatime型出来的数据有可能'年'在后面,用convert转换成char,年就在后面了,我需要年始终在最前面而且是4位,接着是月份,2位数字,怎么办?
odoo基本字段
基础类型:
char
、text、html、boolean、integer、float、
data
、
data
time
、binary 关系类型:one2many、one2one、many2one、many2many 复杂类型:selection、related
char
:字符型,常用来储存长度最小的文本 text:...
C# and Asp.Net Questions 面试题
C# and Asp.Net Questions ...My this article provides a collection of numerous .Net, C#, ADO.NET, Web Services, .Net Framework questions and answers for which a reader has to look aro
C++设计一个日期date类和派生
time
类
私有数据成员
char
* pYMD;//指向字符串的指针,表示“****年**月**日”; 公有成员函数 重载构造函数实现数据成员初始化;(带参数和Copy构造) 重载“=”运算符,实现对象直接赋值; Date& Add([参数...
MySQL之数据类型、建表以及约束
一、MySQL数据类型 ...1、字符类型:
char
var
char
text blob 2、数值类型: int bigint float decimal(货币类型,小数) 3、日期类型:date
time
date
time
time
stamp date -> yyyy:MM:dd HH:mm:ss
time
-&g...
SQL Date
Time
数据类型注意事项和限制
介绍 (Introduction) In this article, we will explorethe SQL Date
Time
data
type and its limitations. 在本文中,我们将探讨SQL日期... As a DBA or SQL developer, we are used to dealing with
data
for many...
MS-SQL Server
34,591
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章