title: Query to find out day of each of employees date of birth
body: <p>I tried this code.But Its not working.(I am using NetBeans Internal database)</p>
  
  <p>Code is-</p>
  
  <pre><code>SELECT DATEPART(yyyy,DOB) AS BirthYear,
  DATEPART(mm,DOB) AS BirthMonth,
  DATEPART(dd,DOB) AS BirthDay
  FROM Employees
  WHERE EmpId=1
  </code></pre>
  
  <blockquote>
    <p>Error-</p>
    
    <p>[Exception, Error code 30,000, SQLState 42X04] Column 'YYYY' is either
    not in any table in the FROM list or appears within a join
    specification and is outside the scope of the join specification or
    appears in a HAVING clause and is not in the GROUP BY list. If this is
    a CREATE or ALTER TABLE  statement then 'DD' is not a column in the
    target table.</p>
  </blockquote>