Solved

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

Posted on 2009-04-04
3
1,258 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 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to take different types of Oracle backups using RMAN.

803 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