title: Query for Trimming the date in SQL
body: <p>I've been asked to write a query to get all the automatic entries that were placed 1 day before the current day.  However, the problem is that the date is in this format and I cannot alter the database.  </p>
  
  <p>E.g. 20130329.134405990</p>
  
  <p>I'm not sure how I would do this.  I was thinking I trim it to the first 8 digits and then minus the current day by 1 day.  I'm not sure how the code would look though, can anyone make any suggestions to my existing code?  That would be greatly appreciated</p>
  
  <p>Existing Query:
  select * from JnlDB 
  where UserCode = 'Automation';</p>