[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


ORA-01830: date format picture ends before converting entire input string

Posted on 2009-04-16
Medium Priority
Last Modified: 2013-12-19
Update table set DISAPPROVED_DATETIME = to_date('" & DateTime.Now & "','mm/dd/yyyy')  where emp_no= 123

i am getting this exeception when i tried to execute this isql....the disapproved_datetime is of datatype "Date"
Question by:yuvaratna
  • 2
  • 2
LVL 32

Expert Comment

ID: 24161476
This, '" & DateTime.Now & "', must not be like 04/16/2009.
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24163846
this should work better:
Update table set DISAPPROVED_DATETIME = to_date('" & DateTime.Now.ToString("mm/dd/yyyy") & "','mm/dd/yyyy')  where emp_no= 123

Open in new window

LVL 32

Expert Comment

ID: 24167067
angelIII's solution should do the trick because it forces the Vb Now() function and the Oracle to_date function to use the same format. Good job.
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24167147
note: if you really are just interested in the "now" or "today" value, you can also use the oracle function sysdate:

Update table set DISAPPROVED_DATETIME = SYSDATE; ---> now (including time)
Update table set DISAPPROVED_DATETIME = TRUNC(SYSDATE);  ---> today 0:00:00'

Open in new window


Author Closing Comment

ID: 31571149
Thanks a lot!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 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