title: MS Access SQL Server DB - Query Syntax for CAST Function
body: <p>I have converted an Access db (.mdb) to SQL Server. In the meantime I still need to use Access as a front end until new application forms are constructed. Can someone tell me what I might do to fix the situation where:</p>
  
  <p>In Access 2007, a query such as:</p>
  
  <pre><code>SELECT *
  FROM TransactionTotals
  WHERE TransactionTotals.[Date]= Date()
  ORDER BY TransactionTotals.EntryID DESC;
  </code></pre>
  
  <p>worked, however since the Date() function will not work with SQL Server, with help in a previous post the correct syntax is:</p>
  
  <pre><code>SELECT *
  FROM TransactionTotals
  WHERE TransactionTotals.[Date]= CAST(GETDATE() AS DATE)
  ORDER BY TransactionTotals.EntryID DESC;
  </code></pre>
  
  <p>BUT! Although the code above will work in a direct SQL Server query (SQL Management Studio), it will be tossed out in Access with a Syntax Error response on the WHERE clause.</p>
  
  <p>Can something be done in Access so I can still run my query bound forms.</p>