sqlserver时间日期处理函数及字符串转换(Sqlserver time, date, processing function, and string conversion).docVIP
- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
sqlserver时间日期处理函数及字符串转换(Sqlserver time, date, processing function, and string conversion)
sqlserver时间日期处理函数及字符串转换(Sqlserver time, date, processing function, and string conversion)
SqlServer time, date, processing function, and string conversion
Article category: Database
Recent statements by SqlServer2005, learning by doing it, although some of the slow speed.
Brief introduction
Date and time functions in Sql Server
1. current system date and time
Select, getdate ()
2. DateAdd returns a new datetime value based on a specified date plus a period of time
For example: add 2 days to the date
Select DateAdd (day, 2,2004-10-15) - Returns: 2004-10-17 00:00:00.000
3. DateDiff returns the date and time bounds across two specified dates.
Select DateDiff (day,2004-09-01,2004-09-18) - Returns: 17
4. datepart returns an integer representing the specified date part of the specified date.
SELECT DATEPART (month,2004-10-15) - returns 10
5. datename returns the string representing the specified date part of the specified date
SELECT datename (weekday,2004-10-15) - Return: Friday
6., day (), month (), year () - can be compared with datepart
Select the current date is =convert (varchar (10), getdate (), 120)
The current time is =convert (varchar (8), getdate (), 114)
Select datename (DW,2004-10-15)
Select how many weeks is this year =datename (week,2004-10-15)?
Today is Zhou, =datename (weekday,2004-10-15)
Function arguments / functions
GetDate () returns the current date and time of the system
DateDiff (interval, date1, date2) returns the difference between the two dates of date2 and date1 in the manner specified by interval, date2-date1
DateAdd (interval, number, date) adds the date after number in the manner specified by interval
DatePart (interval, date) returns the integer value corresponding to the specified part of the interval in the return date date
DateName (interval, date) returns the string name corresponding to the specified part of the interval in the date date
The setting value of the parameter interval is as follows:
The value abbreviations (Sql, Server) (A
您可能关注的文档
- 3《透镜和其应用》测试题1.doc
- 3.1.干涉条件.ppt
- 3.抛体运动规律.ppt
- 3永生眼睛.ppt
- 3《透镜和其应用》测试题4.doc
- 3永生眼睛课件.ppt
- 4-2第二节 气缸盖与曲轴疲劳破坏.doc
- 3第三讲自然界系统演化.ppt
- 4-4金属电化学腐蚀和防护.ppt
- 3.异域风情1——灿烂辉煌人文遗产.ppt
- SQL主键与外键约束.doc
- sql语句时间日期最全方法(SQL statement, time, date, the most complete method).doc
- sql turning(SQL的转折).doc
- sqlplus命令大全(Sqlplus command Daquan).doc
- ss9故障处理(SS9 fault handling).doc
- ssd1963的样例程序 c语言驱动读写程序(Ssd1963 sample program, C language driver to read and write procedures).doc
- sql行转列(SQL row column).doc
- TI、ARM芯片工作原理和改天线开关、飞利普射频供电电路.doc
- TCD正常脑血管检查与识别.doc
- UE快捷键与设置.doc
文档评论(0)