Set Mapping variable in Expression and use it in Source Filter
<p>I have two tables in different databases. In a table A is the data, in the other table B are information for incremental load of the data from the first table. I want to load from table B and store the date of the last successful load from table A in a mapping variable <code>$$LOAD_DATE</code>. To achieve this, I read a date from table B and use the <code>SETVARIABLE()</code> function in a expression to set the <code>$$LOAD_DATE</code> variable. The port in which I do this is marked as output and writes into a dummy flat file. I only read on row of this source!</p>

<p>Then I use this <code>$$LOAD_DATE</code> variable in the Source Filter of the Source Qualifier of table A to only load new records which are younger than the date stored in the <code>$$LOAD_DATE</code> variable.</p>

<p>My problem is that I am not able to set the <code>$$LOAD_DATE</code> variable correctly. It is always the date <code>1753-1-1-00.00.00</code>, which is the default value for mapping variables of the type date/time.</p>

<p>How do I solve this? How can I store a date in that variable and use it later in a Source Qualifiers source filter? Is it even possible?</p>

<p>EDIT: Table A has too much records to read them all and filter them later. This would be to expensive, so they have to be filtered at source filter level.</p>