MS ACCESS SQL Join Subquery
<p>I have two tables: newparts, storedparts </p>

<p>I insert the parts of the newparts, which are not jet in the storedparts into the storedparts:</p>

<pre><code>SQL_String = "INSERT INTO storedparts " &amp; _
             "SELECT newparts.* " &amp; _
             "FROM storedparts " &amp; _
             "RIGHT JOIN newparts ON (storedparts.identifier = newparts.identifier) AND (storedparts.timeStamp = newparts.timeStamp) " &amp; _
             "WHERE ((storedparts.AutoID) Is Null);"
</code></pre>

<p>This is working fine so far. Now the Problem: Table storedparts is getting so big that the programm is taking too Long for the join process. My solution: Just compare the newparts not to all parts of the storedparts, but just to parts that aren't older than 4 days... I tried a subquery like this, but i can't get it to run.</p>

<pre><code>SQL_String = "INSERT INTO storedparts " &amp; _
             "SELECT newparts.* " &amp; _
             "FROM storedparts (WHERE storedparts.timestamp &gt; Now() - 4) " &amp; _
             "RIGHT JOIN newparts ON (storedparts.identifier = newparts.identifier) AND (storedparts.timeStamp = newparts.timeStamp) " &amp; _
             "WHERE ((storedparts.AutoID) Is Null);"
</code></pre>

<p>Any help is appreciated. </p>