Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TO_Date Problems...

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
0
0
US
Hey all,
I'm having a bit of a problem with my To_date Function..

Here's the Query: (In VB, with Oracle 9i backend)

INSERT INTO FN_DOCUMENT
(DOCUMENTID, BATCHID, FNDOCID, FNDOCCLASS, CURRENTSTATUS, INDEXDATETIME, LASTSTATUS)

Values
(FN_DOCUENT_ID_SEQ.NEXTVAL, 1, 117771918, 'Test_POE', 700, TO_DATE('8/15/2002 12:46:02 PM', 'MM.DD.YYYY hh24:mi:ss'), 0);

When VB hits the Query Execute I get this error:

ORA-01830: Date Format picture ends before converting entire input string.

my guess would be that Oracle doesn't like the space, from the date time stamp.. or could it be caused that the month in the string is '8' however, the To-DATE is looking for '08'?

I'm just not 100% sure.. so I thought I'd ask. =)
The PogoWolf
 
if it is HH24 I do not think there IS a PM I tried to remain child-like, all I acheived was childish.
 
TO_DATE('8/15/2002 12:46:02 PM', 'MM/DD/YYYY hh:mi:ss PM') "Helping others to help themselves..."
=================================
Thomas V. Flaherty Jr.
Birch Hill Technology Group, Inc.
 
Does anyone want to comment on how this statement is not using bind variables so any chances of the app being developed scaling up are seriously jeopardised? This is SO common in VB apps...

Regards

Adrian
 
Adrian.. I'm not sure by what you mean there...

but I know that I fixed the issue with VB and Oracle by useing the format command:

TO_DATE('" & Format(Str(Now()), "MM/DD/YYYY hh:MM:SS") & "', 'MM/DD/YYYY hh24:mi:ss')

that sets everything correctly. =)
The PogoWolf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top