0

I need some help guys with this error > ORA-01830: date format picture ends before converting entire input string

INSERT INTO members_contributions 
            (contribution_type, 
             from_date, 
             to_date, 
             added_period_in_months, 
             member_amount, 
             mof_amount, 
             the_currency) 
VALUES      (2, 
             To_date('01/06/2016 12:00:00 AM', 'dd/mm/yyyy'), 
             To_date('30/06/2016 12:00:00 AM', 'dd/mm/yyyy'), 
             1, 
             55, 
             0, 
             'OMR') 
Pirate X
  • 3,023
  • 5
  • 33
  • 60
ALI
  • 19
  • 1
  • 7
  • 3
    Trying counting the number of characters you're passing as the first argument of the `TO_DATE()` calls and the number of characters in the second argument. Any ideas why you might be getting this error? – APC Jun 13 '16 at 07:08

2 Answers2

1

You need to add the time to the format mask

INSERT INTO members_contributions 
            (contribution_type, 
             from_date, 
             to_date, 
             added_period_in_months, 
             member_amount, 
             mof_amount, 
             the_currency) 
VALUES      (2, 
             To_date('01/06/2016 12:00:00 AM', 'dd/mm/yyyy HH:MI:SS AM'), 
             To_date('30/06/2016 12:00:00 AM', 'dd/mm/yyyy HH:MI:SS AM'), 
             1, 
             55, 
             0, 
             'OMR') 
Ricardo Arnold
  • 903
  • 1
  • 12
  • 21
1

In the to_date function you have to mention the matching conversion string

To_date('01/06/2016 12:00:00 AM', 'dd/mm/yyyy HH:MI:SS AM') 
To_date('30/06/2016 12:00:00 AM', 'dd/mm/yyyy HH:MI:SS AM')
Praveen
  • 8,945
  • 4
  • 31
  • 49