0
votes

I'm using Azure Data Factory(V2) to schedule a copy pipeline activity - the requirement is that every day the job should run and select everything from a table, from the last 5 days. I have scheduled the copy and tried the following syntax in the source dataset:

select * from [dbo].[aTable] where [aDate] >= '@{formatDateTime(adddays(pipeline().parameters.windowStart, 'yyyy-MM-dd HH:mm' ),-5)}'

But this doesn't work, I'm getting an error stating that adddays is expecting an int for it's second parameter but is receiving a string.

Can anybody advise on the proper way to nest this??

Thanks

1

1 Answers

1
votes

I cant test this right now, so I'll risk a possible answer just by looking at your query. I think it should be like this:

select * from [dbo].[aTable] where [aDate] >= '@{formatDateTime(adddays(pipeline().parameters.windowStart, -5), 'yyyy-MM-dd HH:mm')}'

Hope this helps!