Solved

how do I resolve error ORA-01861 during query execution

Posted on 2011-09-26
3
1,013 Views
Last Modified: 2012-05-12
When i execute the following query:

elect pdf_name, site, to_char(publication_date, 'YYYY-MM-DD') as publication_date,  modified_date, db_inserted,db_updated from bib_holdings where publication_date <= '1900-01-01';

I get the ORA-01861 error


It is not apparant to me how I am formatting my literal string the wrong way. can someone help me with this?
0
Comment
Question by:sikyala
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 334 total points
Comment Utility
Change:
publication_date <= '1900-01-01'

to:
publication_date <= to_date('1900-01-01','YYYY-MM-DD')
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 334 total points
Comment Utility
Try to never to implicit conversions.

When you need a 'string' use to_char.
When you need a date, use to_date.

Do not let Oracle 'guess' when you need a string turned into a date and what format it is in and visa-versa.
0
 

Assisted Solution

by:iaakov
iaakov earned 166 total points
Comment Utility
Try

where trunc(publication_date) <= to_date('1900-01-01','yyyy-mm-dd')
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now