Solved

ORA 1843 not a valid month

Posted on 2009-07-14
3
1,169 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 74

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 74

Expert Comment

by:sdstuber
ID: 24853198
glad I could help
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
data lookup in Oracle - need suggestions 55 121
Oracle DB monitor SW 21 60
oracle date format checking 7 26
Oracle 12c Default Isolation Level 17 41
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
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 shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
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…

856 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