title: run query multiple times for date range one date at a time...cannot use sproc
body: <p>I only have select access to the database, and cannot create a stored procedure. Any ideas on how to automate a query for a date range when the where clause filters on one data at a time?</p>
  
  <p>For example....I need to run a query similar to the one below for every date between 4/1/2013 and 4/30/2013 one at a time. It seems like I should be able to do this with a cursor or something.</p>
  
  <pre><code>declare @AsOfDate datetime
  SET @AsOfDate = '4/1/2013'
  
  select *,@AsOfDate AS 'AsOfDate' from table p
  where 
  p.ENTER_WQ_DT &lt;= @AsOfDate  and 
  ((coalesce(p.FILE_DATE,p.DELETE_DATE) &gt; @AsOfDate ) or (p.FILE_DATE is null and p.DELETE_DATE is null and WQ_CTE.TAR_ID is not null))
  </code></pre>
  
  <p>I would love to be able to run this and generate a result that contains all records just like if I manually edited the AsOfDate variable and ran it for every day of the month.</p>