FutureDBA-
asked on
help with query, date format
This query gives me error ORA-01843: not a valid month
the ship_date column which is the one i am trying to convert to 05/16/2013 format, is a NUMBER column in 20130516 format.
I've also tried to_char(ship_date, 'MM/DD/YYY') which gives me error ORA-01481: invalid number format model
the ship_date column which is the one i am trying to convert to 05/16/2013 format, is a NUMBER column in 20130516 format.
I've also tried to_char(ship_date, 'MM/DD/YYY') which gives me error ORA-01481: invalid number format model
select
TICKET_ID AS "ID",
VENDOR,
CONTRACT,
to_date(SHIP_DATE, 'MM/DD/YYY'),
trim(' ' from PO_NUMBER) PO_NUMBER,
trim(' ' from FEEDER_SCHOOL) FEEDER_SCHOOL,
CASE WHEN trim(' ' from CODE) = NCSCODE.ITEM THEN NCSCODE.CODES END CODE,
UNIT_PRICE,
QTY,
to_char(QQTY, '9999.99') AS TOTAL_COST,
' ' AS DESCRIPTION
from (week join S on feeder_school = FS and SHIP_DATE = SD) join NCSCODE on ITEM = trim(' ' from CODE) ;
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
This was the best solution for me as it is the easiest to understand.. Thanks
regexp_replace(20130516,'(