Please also have a look in our OnlineHelp for further information.

If you want to use the current date in a where clause, you have to convert the date into a format SAP understands. This is possible by using a Script Task.

First we need to create an SSIS Variable called “TDatum” (data type String, scope Package).


After creating the variable we insert a Script Task.


Double-click on the Script Task and insert the recently created variable in the field ReadWriteVariables. With the button “Edit Script…” the script editor opens.


Insert the following code into the script editor.

public void Main()
           Dts.Variables["TDatum"].Value =  DateTime.Now.ToString("yyyyMMdd"); 
           Dts.TaskResult = (int)ScriptResults.Success;

This code converts the current date to the format year, month and day without any delimiter, and stores the value in the variable “TDatum”. Now we can use this variable in an Xtract IS Table Component to make the where clause dynamic.


The tasks are executed in a row.