Solved

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

Posted on 2009-04-04
3
1,254 Views
Last Modified: 2013-12-19

 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.....
0
Comment
Question by:yuvaratna
  • 2
3 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 24071639
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

0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 24072030
Just noticed you have a couple stray commas in your sql.

Updated:
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

0
 

Author Closing Comment

by:yuvaratna
ID: 31566699
Perfect!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
query returning everything 11 70
Oracle Syntax 8 42
sql query 9 22
Saveas need to save a copy 16 14
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now