title: conversion error from string, when using params in SQL
body: <p>using Delphi 2010 (Firebird [testing], MS Sql Server, Oracle [production])</p>
  
  <p>The following is my SQL</p>
  
  <pre><code>SELECT p.script_no, MIN(p.start_Time) as startTime, MAX(p.end_Time) as endTime, 
  SUM(p.duration) as TotalDuration
  FROM phase_times p
  WHERE (p.script_no=:scriptNo) AND (Trunc(p.start_time) &gt;= :beginDateRange) AND (Trunc(p.start_time) &lt;= :endDateRange) 
  GROUP BY p.script_no
  
  
  
  ParamByName('beginDateRange').AsDate:= Date - 30;
  ParamByName('endDateRange').AsDate:= Date;
  </code></pre>
  
  <p>I am getting a "conversion error from string - 10-25-2012" and i am not sure why, since my datetime fields are in the "10/25/2012 9:20:49 AM" format in the database.</p>
  
  <p>If i change it to the following : ParamByName('beginDateRange').AsString := formatDateTime('mm/dd/yyyy',Date - 30).....i get the error "conversion error from string - 10/25/2012" </p>
  
  <p>reserching this error has provided me no new avenues, do you have any ideas?</p>