title: SQL Server 2012 date and time
body: <p>I'm trying to create a simple database for a class but when entering time or date variables, I get an error. My code looks a little like this:</p>
  
  <pre><code>USE Music
  
  INSERT INTO [dbo].[Album] ([Length], ReleaseDate, DateAdded)
  VALUES ('40:17', '2015/09/18', '2015/10/15 00:00:00.0000')
  </code></pre>
  
  <p>Then I get the following error: </p>
  
  <blockquote>
    <p>Msg 241, Level 16, State 1, Line 3<br>
    Conversion failed when converting date and/or time from character string.</p>
  </blockquote>
  
  <p><code>Length</code> is stored as <code>time(0)</code>, <code>ReleaseDate</code> is stored as <code>date</code>, and <code>DateAdded</code> is stored as <code>datetime2(4)</code>. </p>
  
  <p>Can anyone tell me how to correctly format these so my data will be applied?</p>