title: How to create a time series in Access and can use it in a query
body: <p><strong>The facts:</strong></p>
  
  <p>I use Access 2013, but it must be run in Access 2007 aswell.</p>
  
  <p>I have the following 3 tables:</p>
  
  <p>Order:</p>
  
  <pre><code>Id      DateFrom        DateTo  
  1       2014-12-01      2015-03-01
  2       2014-01-02      2015-03-01
  3       2015-01-03      2015-03-01
  </code></pre>
  
  <p>Stock:</p>
  
  <pre><code>Id      Label       Amount
  1       Product1    20
  2       Product2    10 
  </code></pre>
  
  <p>OrderStock:</p>
  
  <pre><code>Id      OrderId     StockId     Amount
  1       1           1           10
  2       2           1           5
  3       2           2           5
  4       3           2           5
  </code></pre>
  
  <p>The users input:</p>
  
  <ul>
  <li>DateFrom: 2015-01-01 </li>
  <li>DateTo: 2015-01-03 </li>
  <li>StockIds: 1 and 2</li>
  </ul>
  
  <p><strong>The question:</strong></p>
  
  <p>It's possible to create a 'temporary' table for a sub-query with dates from X to Y? From the user input, which would look like this:</p>
  
  <pre><code>dates
  2015-01-01
  2015-01-02
  2015-01-03
  </code></pre>
  
  <p>I would like to have the following result:</p>
  
  <pre><code>Date        StockLabel  AmountInUse     AmountAvailable
  2015-01-01  Product1    10              10
  2015-01-01  Product2    0               10
  2015-01-02  Product1    15              5
  2015-01-02  Product2    5               5
  2015-01-03  Product1    15              5
  2015-01-03  Product2    10              0
  </code></pre>
  
  <p>How would the query look like, if it is even possible in Access without VBA?</p>