title: ORA-06502: PL/SQL: numeric or value error: character to number conversion error - TO_DATE error?
body: <p>I have a trigger statement where I want to compare two date values and subtract them. When I attempt to do this I get the error <em>ORA-06502: PL/SQL: numeric or value error: character to number conversion error</em></p>
  <p>Here is the trigger code along with the insert I am attempting to do.</p>
  <pre><code>CREATE OR REPLACE TRIGGER BALANCE_FEE
  AFTER INSERT OR UPDATE OR DELETE ON CHARTERS
  FOR EACH ROW 
  DECLARE
  FEE NUMBER;
  ACL_DATE DATE;
  EXP_DATE DATE;
  GRP_ID NUMBER;
  
  BEGIN
  
  ACL_DATE := :NEW.ACL_RETURN_DATE;
  EXP_DATE := :NEW.EXP_RETURN_DATE;
  GRP_ID := :NEW.GRP_ID;
  
  
  IF ACL_DATE &gt; EXP_DATE
  THEN
  FEE := (ACL_DATE - EXP_DATE) * 75;
  
  IF ACL_DATE &lt; EXP_DATE
  THEN
  FEE := (ACL_DATE - EXP_DATE)* -20;
  
  ELSE
  FEE := 0;
  END IF;
  END IF;
  UPDATE CUSTOMER
       SET CUSTOMER.BALANCE = CUSTOMER.BALANCE + FEE
       WHERE CUSTOMER.GRP_ID = GRP_ID;
  END;
  /
  SHOW ERROR;
  </code></pre>
  <p>Here are the insert statements I am trying to do.</p>
  <pre><code>INSERT INTO CHARTERS (CHARTER_ID,BOAT_ID,EXP_RETURN_DATE,ACL_RETURN_DATE,GRP_ID) VALUES ('T001','B001',TO_DATE ('2019/01/20', 'yyyy/mm/dd'),TO_DATE ('2019/01/20', 'yyyy/mm/dd'),'G002');
  INSERT INTO CHARTERS (CHARTER_ID,BOAT_ID,EXP_RETURN_DATE,ACL_RETURN_DATE,GRP_ID) VALUES ('T002','B002',TO_DATE ('2019/03/10', 'yyyy/mm/dd'),TO_DATE ('2019-03/08', 'yyyy/mm/dd'),'G001');
  INSERT INTO CHARTERS (CHARTER_ID,BOAT_ID,EXP_RETURN_DATE,ACL_RETURN_DATE,GRP_ID) VALUES ('T003','B003',TO_DATE ('2019/05/05', 'yyyy/mm/dd'),TO_DATE ('2019/05/07', 'yyyy/mm/dd'),'G003');
  </code></pre>
  <p>If it helps here is the table for charters if you think it may have something to do with that.</p>
  <pre><code>CREATE TABLE CHARTERS (
      CHARTER_ID VARCHAR(20),
      BOAT_ID VARCHAR(20) REFERENCES BOAT(BOAT_ID),
      GRP_ID VARCHAR(20) REFERENCES CUSTOMER(GRP_ID),
      EXP_RETURN_DATE DATE,
      ACL_RETURN_DATE DATE);
  </code></pre>
  <p>and this is the error code I get when trying to run all three insert statements</p>
  <pre><code>INSERT INTO CHARTERS (CHARTER_ID,BOAT_ID,EXP_RETURN_DATE,ACL_RETURN_DATE,GRP_ID) VALUES ('T003','B003',TO_DATE ('2019/05/05', 'yyyy/mm/dd'),TO_DATE ('2019/05/07', 'yyyy/mm/dd'),'G003')
  Error report -
  ORA-06502: PL/SQL: numeric or value error: character to number conversion error
  ORA-06512: at &quot;ADMIN_BF.BALANCE_FEE&quot;, line 11
  ORA-04088: error during execution of trigger 'ADMIN_BF.BALANCE_FEE'
  </code></pre>