Solved

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

Posted on 2009-04-04
3
1,260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

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 75

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

739 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