如何将日期时间中的日期存储在变量中,并将该变量传递到u-sql的where子句中
DeclARE @transacationalfullpath =“ Data_Input {*}”;
DeclARE @destinationoutputfilename字符串=“ out”; //目标文件名
@ transactionaldata = EXTRact [Createddate]字符串,合同字符串, SourceFileURI = FILE.URI(),SourceFileModifieddate = FILE.MODIFIED(),SourceFileCreateddate = FILE.CREATED(), SourceFileSize = FILE.LENGTH() 来自@transacationalfullpath 使用Extractors.Text(delimiter:'〜',引用:false,silent:true);
@deltaFileModifiedTime =
SELECT
SDate
FROM
(
SELECT DISTINCT SourceFileModifieddate AS SDate
FROM @transactionaldata
ORDER BY SourceFileModifieddate ASC FETCH 1行 )AS x;
@data =
EXTRact [创建日期]字符串,合同字符串, __date DateTime 摘自“ Data_Input-{__ date:yyyy}-{__ date:MM}-{__ date:dd}-*” 使用Extractors.Text(delimiter:'〜',引用:false,silent:true);
@deltaTransactionDataSource =
SELECT *
FROM @data AS a
CROSS JOIN
@deltaFileModifiedTime AS b
WHERE
__date > b.SDate;
输出@deltaTransactionDataSource 到@destinationoutputfilename 使用Outputters.Text(delimiter:'〜',引号:false);
对于此代码,没有任何错误,但输出为空