title: access sql statement is returning nothing!
body: <p>i am having a problem with access sql SELECT statement. the problem is that when the backend is ACCESS-2007 it works; however when the backend is sql-server-2008, it is not returning anything. here is the statement:</p>
  
  <pre><code>SELECT IIf([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.11*Other*','1.11 Other',[Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) AS [Occurrence Code], Count([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) AS [Count]
  FROM [Lab Occurrence Form]
  WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between  Forms!Meeting_Reasons_Frequency!Text4  And  Forms!Meeting_Reasons_Frequency!Text2 )) And [Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.*'
  GROUP BY IIf([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.11*Other*','1.11 Other',[Lab Occurrence Form].[1 0 Preanalytical (Before Testing)])
  HAVING ((Count([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]))&lt;&gt;0)
  ORDER BY IIf([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)] Like '*1.11*Other*','1.11 Other',[Lab Occurrence Form].[1 0 Preanalytical (Before Testing)])
  </code></pre>
  
  <p>please note that what is not working is this: <code>Forms!Meeting_Reasons_Frequency!Text4</code>  and this <code>Forms!Meeting_Reasons_Frequency!Text2</code> - when i replace those with constant values they work; however the trouble is that it they are not reading correctly what is in the textbox for some reason.</p>
  
  <p>again: this query is working FINE with access as a backend, however when the backend switches to sql server it is not working! the reason again is because of the <code>forms!text</code> thing. does anyone know why?</p>
  
  <p><strong>update</strong>
  thanks to bob's suggestion i ran profile on sql-server and found something funny. it is indeed working correctly, however it is returning the date like this:</p>
  
  <pre><code>@P1 datetime,@P2 datetime','2010-04-30 00:00:00','2010-04-01 00:00:00'
  </code></pre>