Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 如何为SSIS表达式添加时间?_Sql Server_Tsql_Ssis - Fatal编程技术网

Sql server 如何为SSIS表达式添加时间?

Sql server 如何为SSIS表达式添加时间?,sql-server,tsql,ssis,Sql Server,Tsql,Ssis,我当前使用此表达式获取当前时间: Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2) <br> + Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2) Right(“0”+(DT_STR,21252)DatePart(“hh”,getdate()),2) +右(“0”+(DT_STR,21252)日期部分(“mi”,getdate()),2) 示例输出:1830

我当前使用此表达式获取当前时间:

Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2) <br>
+ Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2)
Right(“0”+(DT_STR,21252)DatePart(“hh”,getdate()),2)
+右(“0”+(DT_STR,21252)日期部分(“mi”,getdate()),2)
示例输出:1830

如何加上或减去小时来计算时区?

您正在寻找该函数。因此,要在当前日期的基础上增加2小时,您可以执行以下操作:

DATEADD(hour, 2, getdate())
您正在寻找函数。因此,要在当前日期的基础上增加2小时,您可以执行以下操作:

DATEADD(hour, 2, getdate())

我没有得到你想要的,但是dateadd(hour,5,getdate())可以用来在date中添加小时,可以用来从date中获取时间,而dateadd(hour,5,getdate())可以用来在date中添加小时,可以用来从date中获取时间