title: Trouble INSERT INTO string value into DATETIME msSQL datatype
body: <p>I have looked all over the place and I can't find the answer.</p>
  
  <p>Here is the error I am getting using ColdFusion and MsSQL</p>
  
  <pre><code>Error Executing Database Query.
  
  [Macromedia][SQLServer JDBC Driver][SQLServer]Conversion failed when converting date and/or time from character string.
  
  The error occurred in SQL
  
  INSERT INTO Requests ( 
      RequestName, 
      RequestEmail, 
      RequestPhone, 
      RequestType, 
      RequestSiteSection, 
      RequestDue, 
      RequestUrgent, 
      RequestTitle, 
      RequestURL, 
      RequestMessage, 
      Attachment1, 
      Attachment2, 
      Attachment3, 
      Attachment4, 
      Attachment5, 
      RequestCreated, 
      RequestModified, 
      RequestPriority, 
      RequestAssignedTo, 
      RequestStatus 
  ) 
  VALUES ( 
      '', 
      'Joshua &gt;Davis', 
      'onebigcelt@gmail.com', 
      '8046789', 
      'Correction', 
      'Natural Heritage', 
      '09/11/2013', 
      'This is the Title of the REQUEST!', 
      'http://www.dcr.virginia.com', 
      'rewas', 
      '/opt/coldfusion8/runtime/servers/coldfusion/SERVER-INF/temp/wwwroot-tmp/neotmp47128.tmp', 
      '', 
      '', 
      '', 
      '', 
      (param 1), 
      (param 2), 
      '0', 
      'Webmaster', 
      'Pending' 
  )
  </code></pre>
  
  <p>Each param is <code>cfqueryparam cfsqltype='CF_SQL_timestamp' value='#CreateODBCDateTime(now())#'</code></p>
  
  <p><strong>this error comes up when I try to insert using any of the following</strong></p>
  
  <ul>
  <li>cfqueryparam cfsqltype='CF_SQL_timestamp' value='#CreateODBCDateTime(now())#'</li>
  <li>now()</li>
  <li>CreateODBCDateTime(now())</li>
  <li>SQL getDate()</li>
  <li>an other variations</li>
  </ul>
  
  <p>I have tried concatenating time and date together, cast and convert to datetime , formating the date and time  but no luck I am stuck.</p>
  
  <p>I appreciate your help.</p>
  
  <p>here is the query</p>
  
  <pre><code>INSERT INTO Requests (
      RequestName,
      RequestEmail,
      RequestPhone,
      RequestType,
      RequestSiteSection,
      RequestDue,
      RequestUrgent,
      RequestTitle,
      RequestURL,
      RequestMessage,
      Attachment1,
      Attachment2,
      Attachment3,
      Attachment4,
      Attachment5,
      RequestCreated,
      RequestModified,
      RequestPriority,
      RequestAssignedTo,
      RequestStatus
  )
  VALUES(
     '&lt;cfif IsDefined('form.requestUrgent')&gt;#form.requestUrgent#&lt;/cfif&gt;',
     '#form.requestName#',
     '#form.requestEmail#',
     '#form.requestPhone#',
     '#form.requestType#',
     '#form.requestSection#',
     '#form.requestDueDate#',
     '#form.requestTitle#',
     '#form.requestURL#',
     '#form.requestMessage#',
     '#form.attachment1#',
     '#form.attachment2#',
     '#form.attachment3#',
     '#form.attachment4#',
     '#form.attachment5#',
     getdate(),
     getdate(),
     '0',
     'Webmaster',
     'Pending'
  )
  </code></pre>
  
  <p>You can sub out the <code>getDate()</code> with any of the above options <code>#var#</code> convert cast, param, etc</p>