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
Medium Priority
1,265 Views

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

How can i solve this.....
0
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
• 2

LVL 75

Expert Comment

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
``````
0

LVL 75

Accepted Solution

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
``````
0

Author Closing Comment

ID: 31566699
Perfect!
0

## Featured Post

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…