title: Why is my DATEPART not working?
body: <p>I am trying to learn SQL and I am having trouble getting DATEPART to work. My table is Payment and the column name is BirthDay. </p>
  
  <p><strong>Question: What do I have out of order here?</strong></p>
  
  <p>The question is why is the SQL statement throwing an error. Thanks to the reads they found a simple syntax issue. </p>
  
  <p>What does the @columnName do? Is it better to have the tableName.ColumnName or should a person use the @columnName.</p>
  
  <pre><code>     1970-04-05
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>SELECT DATEPART(yyyy,p.BirthDay) AS OrderYear,
         DATEPART(mm,  p.BirthDay) AS OrderMonth,
         DATEPART(dd,  p.BirthDay) AS OrderDay
  FROM Payment as p;
  </code></pre>
  
  <p>This is the image of the screen.</p>
  
  <p><img src="https://i.stack.imgur.com/r2cR5.jpg" alt="enter image description here"></p>