Link to home
Start Free TrialLog in
Avatar of yuvaratna
yuvaratna

asked on

ora-01847 day of month must be between 1 and lastday of month


 sql = "Update Table1 set , column1 = to_date('" & 

ExpensereportReceiveddate.Date & "','mm/dd/yyyy'),  column2 = to_date('" & 

Expensereportacctng.Date & "','mm/dd/yyyy'),  where emp_NO=" & emp_no


When i tried to debug it, Assuming that the user didnt eneter any thing in the date fields..This is the sql it returned....

 
Update travel_auth set  column1 = to_date('12:00:00 AM','mm/dd/yyyy'),  

column2 = to_date('12:00:00 AM','mm/dd/yyyy') where

emp_NO=191


 ExpensereportReceiveddate is declared As Date

How can i solve this.....
Avatar of kaufmed
kaufmed
Flag of United States of America image

Try the following:
sql = "Update Table1 set , column1 = to_date('" &
 
ExpensereportReceiveddate.Date.ToString("MM/dd/yyyy") & "','mm/dd/yyyy'),  column2 = to_date('" &
 
Expensereportacctng.Date.ToString("MM/dd/yyyy") & "','mm/dd/yyyy'),  where emp_NO=" & emp_no

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yuvaratna
yuvaratna

ASKER

Perfect!