title: How to convert a Calendar into the DD-Mon-YY format and weird query results
body: <p>I have an sql database which has dates in this format ex: 21-JAN-07 and I am creating a query in Java using the Calendar element, however I can't seem to find a function that convert to this format since this doesn't work</p>
  
  <pre><code>    DateFormat formatData = new SimpleDateFormat("DD-Mon-YY");
      String dateString= formatData.format(time);
  </code></pre>
  
  <p>I could concatenate my own string, but first I find weird that I can't find a method that does this and also I noticed that when I query manually the database like this</p>
  
  <pre><code> SELECT Technical_Key FROM DIM_CUSTOMER WHERE '01-JAN-99' &lt;= VERSION_START ORDER BY VERSION_START DESC 
  </code></pre>
  
  <p>It's returning me rows with VERSION_START earlier than '01-JAN-99' for example 07-JAN-07. So I am not entirely sure whats' going on</p>