title: Convert a date and time into a MS SQL select query using SelectParameters
body: <p>I have this situation where I have a SqlDatasource control and the select query is like:</p>
  
  <pre><code>SELECT col1, col2 FROM table1 WHERE colDate = @date
  </code></pre>
  
  <p>The source of @date is a label with the text: 2009-05-29 12:06:00
  I get the following error when I run the query:</p>
  
  <blockquote>
    <p>Conversion failed when converting date
    and/or time from character string</p>
  </blockquote>
  
  <p>I tried using convert(datetime, @date), as well as different date/time formatting of the label itself. Everytime I get the error.</p>
  
  <p>However, when I run the query in the management studio like:</p>
  
  <pre><code>    SELECT col1, col2 FROM table1 WHERE colDate = '2009-05-29 12:06:00'
  </code></pre>
  
  <p>it works like a charm!</p>
  
  <p>Does anyone have any idea what I'm missing?</p>
  
  <p>EDIT:</p>
  
  <p>I found out that the @date is parsed as 05-29-2009 01:30:00 TT 
  I don't know where the TT is coming from? And I'm sure SQL Server wouldn't be able to handle it?</p>