Reputation: 167
How can I find the date of the last Saturday from a current date in ADF (set as a variable) ?
For example in SQL I can run this query and it will return the last Saturday:
but I don't want to create a lookup activity to connect to the database and run that query. I want to define it as a variable.
Is it possible to create a variable that always returns the last Saturday?
Kind regards
Upvotes: 0
Views: 660
Reputation: 11529
You can use below expression to get the last saturday always in set variable activity.
@FormatDateTime(addDays(subtractFromTime(utcnow(),dayOfWeek(utcnow()),'Day'),-1),'yyyy/MM/dd')
Set variable:
Result:
Upvotes: 1