Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-04
3
Medium Priority
?
1,265 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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
Suggested Courses

636 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