在sqlserver 2005中设置行的默认时间 [英] To set the default Time for a row in sqlserver 2005

查看:117
本文介绍了在sqlserver 2005中设置行的默认时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个函数来获取默认日期,Getdate(),这个函数得到系统短时间



格式化,这没关系,



但是当我回复这个日期时我无法更改日期格式..



select colum1,convert(varchar(最大),日期,103)来自table_name

它无法正常工作..



推荐给我PLZ



谢谢,



vijay

i was used this function to get default date, Getdate(),this function get the system short time

Format,this is okay,

but when i retrive this date i couldnt change the date format ..

"select colum1,convert(varchar(max),date,103) from table_name"
its not working..

Refer me plz

Thanks,

vijay

推荐答案

你应该使用getdate()如果要更改日期格式,则可以选择转换函数中的日期而不是日期。请通过以下链接查看选项:



http: //www.w3schools.com/sql/func_convert.asp [ ^ ]



如果我错了请发布你得到的错误
You should use getdate() instead of date in the convert function if you want to change the date format you have options. pls go through below link to check the options:

http://www.w3schools.com/sql/func_convert.asp[^]

if i am wrong please post what is the error you are getting


这篇关于在sqlserver 2005中设置行的默认时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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