title: Format date in hql query
body: <p>i want to format date to string in hql select, for example i have purchasing data with transaction date in it:</p>
  
  <pre>class Purchase {
  
    private Date datePurchase
  
  }</pre>
  
  <p>and i want to select date in a certain format, for example yyyyMMdd, can i do that in hql?</p>
  
  <p>actually i can iterate through all purchase data returned by query, and start to format the date using SimpleDateFormat, but i don't want do that, i want to do it in hql, is it posible?</p>
  
  <p>fyi, i just want to return the id and date string only, not all Purchase field.</p>
  
  <p>thak you all for any help.</p>