Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Create a helper table Beta:</p> <pre><code> CREATE TABLE Beta ( Monat DATETIME, ) </code></pre> <p>fill it with all monthes you need:</p> <pre><code> INSERT INTO Beta VALUES( '1/1/2010' ) ... INSERT INTO Beta VALUES( '1/12/2010' ) ' maybe '12/1/2010' </code></pre> <p>and:</p> <pre><code> SELECT A.Id, B.Monat, A.Value FROM &lt;YourTable&gt; A, Beta B WHERE B.Monat &gt;= A.StartDate And B.Monat &lt;= A.EndDate </code></pre> <p>(no garanties wrt performance)</p> <p>I did not anticipate that something like this has to be 'proven' - </p> <pre><code> =============================================================================== SO5192555 - select for hungryMind ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- SELECT * FROM Alpha ------------------------------------------------------------------------------- |Id|StartDate|EndDate |Value| | 1| 2/1/2010|6/1/2010| 20| | 2| 5/1/2010|7/1/2010| 80| ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- SELECT A.Id, B.Monat, A.Value FROM Alpha A, Beta B WHERE B.Monat &gt;= A.StartDate And B.Monat &lt;= A.EndDate ------------------------------------------------------------------------------- |Id|Monat |Value| | 1|2/1/2010| 20| | 1|3/1/2010| 20| | 1|4/1/2010| 20| | 1|5/1/2010| 20| | 1|6/1/2010| 20| | 2|5/1/2010| 80| | 2|6/1/2010| 80| | 2|7/1/2010| 80| =============================================================================== xpladolib.vbs: Erfolgreich beendet. (0) [ 0.17969 secs ] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload