如何将第三个参数(年)作为变量传递给dateadd()方法 [英] how to pass third parameter ( year) as a variable to dateadd() method

查看:174
本文介绍了如何将第三个参数(年)作为变量传递给dateadd()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将第三个参数(年份)作为变量传递给dateadd()方法
例如
dateadd(ww,4,@ year)代替dateadd(ww,4,''2011''),还是可以在dateadd()方法中使用datepart()方法分隔年份?

DATEADD (datepart , number , date )包含3个参数.
如果要添加年份,请在日期部分使用YY,然后将年份(以int形式)作为第二个变量传递.


请参见此处 [ 解决方案

DATEADD (datepart , number , date ) includes 3 parameters.
If you want to add an year use YY in the datepart and pass the year (as int) as the second variable.


See
here[^].


这篇关于如何将第三个参数(年)作为变量传递给dateadd()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发语言最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆