title: using convert_tz for datetime comparisons
body: <p>I have a table with day/time values that are split into date and an int fields respectively rather than a single datetime. Each row has a unique combo of date and hour, so there are 24 rows per each day.</p>
  
  <p>My challenge is selecting data relevant for users in a different timezone when I need to take these timezone adjustments into account in the where statement. For example, if the user's two hours ahead of the server time, the where statement needs to reflect it:</p>
  
  <pre><code> ...where concat(theDate,' ',theHour) &gt; convert_tz(concat('2012-01-01',' ','00:00:00'), '-8:00', '-6:00')
  </code></pre>
  
  <p>..for, say, PST to central time. But obviously I can't use convert_tz or a value with which it was calculated in a where clause. </p>
  
  <p>I'd like to use convert_tz rather than clumsy DATE_ADD or whatever. What can be done?</p>
  
  <p>Maybe I'm wrong and you can have convert_tz in a where clause. Here's the core issue:</p>
  
  <pre><code>select *, convert_tz(concat(theDay,' ',theHour), '-8:00', '-8:00') 'dayTZ' 
  from stats 
  where convert_tz(concat(theDay,' ',theHour), '-8:00', '-8:00') &gt; '2011-01-25 05:00:00';
  </code></pre>
  
  <p>The above's still returning hour values earlier than 5.</p>