私は次のSQLを持っています
SELECT * FROM (
select id,ROW_NUMBER() OVER (ORDER BY id) as row
from order where
(shopkeeper=116363) and (status > 0) and
(status <> 2) and
[creationdate] >= convert(datetime,'06/07/2013 00:00:01',103) and
[creationdate] <= convert(datetime,'20/07/2013 23:59:59',103) ) a
WHERE row BETWEEN 1 AND 100
このクエリに「ID による順序」を追加したいのですが、最後に追加するとエラーが発生し、後で追加すると<= convert(datetime,'20/07/2013 23:59:59',103)
エラーが発生します。
これをクエリのどこに追加すればよいですか? ありがとう