title: SQL Epoch Time "Where" Statement
body: <p>I have two questions regarding querying data in SQL that uses Epoch time stamps. I'm able to convert the date in my SELECT statement using this text:</p>
  
  <pre><code>DATEADD(HOUR, -4, DATEADD(SECOND, aa.fldTimeOfEvent, '1970-01-01 00:00:00'))
  </code></pre>
  
  <p>I had to use the "hour,-4" to convert it to Eastern daylight savings time.  I'm curious if I will need to adjust this to -5 in November when daylight savings time ends?  Is there a way to formulate the SELECT statement so it automatically adjusts for DST?  This will be part of an automated report and I'm afraid we may miss changing this value.</p>
  
  <p>Another question is how to use the WHERE statement to get data for a certain day.  For instance, if I wanted the WHERE statement to grab all entries that occurred any time today (7/14/16), how would I do that?  I've tried this statement:</p>
  
  <pre><code>WHERE DATEADD(HOUR, -4, DATEADD(SECOND, aa.fldTimeOfEvent, '1970-01-01 00:00:00')) = '2016-07-14'
  </code></pre>
  
  <p>It appears to only grab the entries that are exactly equal to midnight of that day (I think).  I want all entries that occurred for any time the day.</p>
  
  <p>Thanks in advance for your help.</p>