title: Calculating current school year
body: <p>I am trying to calculate what the CURRENT school year is, based off of sysdate.</p>
  
  <p>Since academic school years generally run from (approximately) August - May, I need to look at what the current month is to determine which school year we are actually in.</p>
  
  <p>For example, if the current month is May of 2013, then it would be the 2012-2013 school year.  However, if the current month is September of 2013, then it would be 2013-2014 school year.</p>
  
  <p>I suspect my approach is way off and there is a much easier way to accomplish this, but here is the portion of sql code I am working with now:</p>
  
  <pre><code>WHERE to_date(ps_customfields.getStudentscf(s.id,'VolTran_ExpDate'),'MM/DD/YYYY') BETWEEN 
  
  CASE 
      WHEN to_char(sysdate,'MM') &lt; '08' THEN '08/01'||(to_char(sysdate,'YYYY')-1) and '08/01/'||to_char(sysdate,'YYYY') 
      WHEN to_char(sysdate,'MM') &gt;= '08' THEN '08/01'||to_char(sysdate,'YYYY') and '08/01/'||(to_char(sysdate,'YYYY')+1)
  END
  </code></pre>
  
  <p>The ps_customfields.getStudentscf(s.id,'VolTran_ExpDate') field is a plain text field, which is why I'm casting it as a date.</p>
  
  <p>The error I'm getting in SQLDeveloper with this specific code is "ORA-00905: missing keyword", but I haven't been able to pin down what I'm missing.</p>
  
  <p>Can anybody suggest a more elegant way to accomplish this???</p>
  
  <p>Thank You</p>