title: I have to get month and year from due_dt column and pass that as input in sql
body: <pre><code>select sum(NVL(CL.TOTAL_REPAY_AMT,0) + NVL(re.INSURANCE_DUE_AMT,0)) as installment_amount
         , sum(RE.LI_DUE_AMT) as life_insurance
         , sum(RE.PI_DUE_AMT) as property_insurance
         , (SUM(NVL(CL.TOTAL_REPAY_AMT,0) + NVL(re.INSURANCE_DUE_AMT,0)) + SUM(RE.LI_DUE_AMT) + SUM(RE.PI_DUE_AMT)) as total_amount
         , count(cl.ref_num_1) as Count_loans
         , SUM(cl.DR_INTRST_RT) AS INTREST
  from cr_loan cl
  join repayment_events re on cl.pos_num = re.pos_num 
  and CL.DR_INTRST_RT = 0
  and RE.LAST_EVENT_STAT IN (1,11) 
  AND RE.DUE_DT = '01-JUNE-2083'
  </code></pre>
  
  <p>I am trying to extract month and year and pass that as input for due_dt column. I tried using substring but that didn't work:</p>
  
  <pre><code>SUBSTR(RE.DUE_DT, 4,15) ='JUNE-2083'
  </code></pre>
  
  <p>Please help me</p>