title: SQL Server SQL syntax - selecting rows between and ordering
body: <p>I have the following SQL</p>
  
  <pre><code>  SELECT * FROM ( 
     select id,ROW_NUMBER() OVER (ORDER BY id) as row 
     from order where 
         (shopkeeper=116363) and (status &gt; 0) and 
         (status &lt;&gt; 2) and 
         [creationdate] &gt;= convert(datetime,'06/07/2013 00:00:01',103) and
         [creationdate] &lt;= convert(datetime,'20/07/2013 23:59:59',103) ) a 
    WHERE row BETWEEN 1 AND 100 
  </code></pre>
  
  <p>I want to add an "order by ID" to this query but when I add it to the end I get an error and when I add it after <code>&lt;= convert(datetime,'20/07/2013 23:59:59',103)</code> I also get an error.</p>
  
  <p>Where do I add this to the Query?
  Thanks</p>