Solved

ORA 1843 not a valid month

Posted on 2009-07-14
3
1,162 Views
Last Modified: 2013-12-19
I need to format the three dates in three different ways.
I am getting not valid month error.
Can you help? Thanks! Beth
SELECT 

PACKLIST.PACKLIST_NO, 

to_date(TRANSACTION_DATE, 'dd-mm-yyyy'), 

to_date(SCHEDULED_SHIP_DATE, 'mm-dd-yyyy'), 

to_date(ACTUAL_SHIPPED_DATE, 'mm-dd-yy'),

JOBCOST_UNITS * COST_PER_UNIT AS EXTENDED_COST
 

FROM PACKLIST, JOBCOST
 

WHERE PACKLIST.PACKLIST_NO = JOBCOST.PACKLIST_NO;

Open in new window

0
Comment
Question by:ba_trainer
  • 2
3 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 24853164
if the three columns are dates, use to_char instead of to_date


SELECT
PACKLIST.PACKLIST_NO,
to_char(TRANSACTION_DATE, 'dd-mm-yyyy'),
to_char(SCHEDULED_SHIP_DATE, 'mm-dd-yyyy'),
to_char(ACTUAL_SHIPPED_DATE, 'mm-dd-yy'),
JOBCOST_UNITS * COST_PER_UNIT AS EXTENDED_COST
FROM PACKLIST, JOBCOST
WHERE PACKLIST.PACKLIST_NO = JOBCOST.PACKLIST_NO;
0
 

Author Closing Comment

by:ba_trainer
ID: 31603436
they are - perfect!! thanks so much! Beth
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 24853198
glad I could help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

912 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

20 Experts available now in Live!

Get 1:1 Help Now