title: How to select part of a Timestamp in a SQL Query
body: <p>In the DB I am working with, I want to select only the year from a specific TimeStamp field.  In particular, I'm hoping to select the unique years from this database column.</p>
  
  <p>For instance, if all of the timestamps in the field <code>"ModifyTimeStamp"</code> are either from the year 2002 or the year 2006, I would like returned simply a result of '2002' and '2006'.  If this is impossible, I'd be content with getting a result of a bunch of '2002's mixed with '2006's and would parse it later.</p>
  
  <p>All I've been able to get working so far is <code>"Select ModifyTimeStamp from Table"</code> - all my attempts to parse have failed.  I started reading about the <code>extract</code> command for SQL, but I believe it's only for PostgreSQL.  </p>
  
  <p>Any advice greatly appreciated!</p>
  
  <p><strong>Edit</strong>: Got the answer, thanks a lot datagod and Marc.  The code I was looking for ended up being:</p>
  
  <p><code>"Select distinct YEAR(ModifyTimeStamp) from Table"</code></p>