title: how can I solve a issue with andWhere with symfony/doctrine and odbc?
body: <p>While following the symfony tutorial (1.4.4) I'm getting an error with ODBC/mssql 2008.</p>
  
  <blockquote>
    <p>SQLSTATE[07002]: COUNT field incorrect: 0 [Microsoft][SQL Server
    Native Client 10.0]COUNT field incorrect or syntax error
    (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:254). Failing Query:
    "SELECT [j].[id] AS [j__id], [j].[category_id] AS [j__category_id],
    [j].[type] AS [j__type], [j].[company] AS [j__company], [j].[logo] AS
    [j__logo], [j].[url] AS [j__url], [j].[position] AS [j__position],
    [j].[location] AS [j__location], [j].[description] AS
    [j__description], [j].[how_to_apply] AS [j__how_to_apply], [j].[token]
    AS [j__token], [j].[is_public] AS [j__is_public], [j].[is_activated]
    AS [j__is_activated], [j].[email] AS [j__email], [j].[expires_at] AS
    [j__expires_at], [j].[created_at] AS [j__created_at], [j].[updated_at]
    AS [j__updated_at] FROM [jobeet_job] [j] WHERE ([j].[category_id] =
    '2' AND [j].[expires_at] > ?) ORDER BY [j].[expires_at] DESC"</p>
  </blockquote>
  
  <p>I've narrowed the problem to a line that uses parameters
  <code>
  public function getActiveJobs(Doctrine_Query $q = null)
      {
          if (is_null($q))
          {
              $q = Doctrine_Query::create()
                ->from('JobeetJob j');
          }</p>
  
  <pre><code>    //$q-&gt;andWhere('j.expires_at &gt; \''.date('Y-m-d H:i:s', time()).'\'');&lt;-- this works
      $q-&gt;andWhere('j.expires_at &gt; ?', date('Y-m-d H:i:s', time())); //&lt;-- this line has problem
      $q-&gt;addOrderBy('j.expires_at DESC');
  
      return $q-&gt;execute();
  }
  </code></pre>
  
  <p></code></p>
  
  <p>can anyone point me in the right direction?
  Thanks.</p>