title: How to get previous day date in Hive
body: <p>I am novice to Hive. Trying to get the previous day date using the below query:</p>
  
  <pre><code>SELECT MAX(id) FROM store_rcd_table
  WHERE recon_dt = unix_timestamp(date_sub(from_unixtime(unix_timestamp(),
  'yyyy-MM-dd'),1),'yyyy-MM-dd')
  </code></pre>
  
  <p>but getting the NULL as output. The output should have been date(2017-09-23) and MAX(id).</p>
  
  <p>Also tried,</p>
  
  <pre><code>Select MAX(id) FROM store_rcd_table
  WHERE recon_dt ='2017-09-24';
  </code></pre>
  
  <p>No output for this query also, just OK is coming as an output.</p>
  
  <p>Not getting what the issue is? Any suggestion/ help is appreciated.</p>
  
  <p>The structure of the table is:</p>
  
  <pre><code>id              string                                      
  locationid      string                                      
  mngrid          string                                      
  empid           string                                                                          
  deleted         boolean                                     
  recon_dt        string                                      
  </code></pre>