Connecting Tech Pros Worldwide Help | Site Map

Conversion of date format

Newbie
 
Join Date: Jun 2007
Posts: 2
#1: Jun 18 '07
Hi,

i need to convert a date into another date format but when i use TO_CHAR or TO_DATE key word to convert the date format the error given is:-
Error starting at line 1 in command:
update ln_si_addr_ex_support set trans_date = to_date('03:50:53 11 Jun 2007','YYYY-mm-DD HH24:MI:SS')
Error report:
SQL Error: ORA-01843: not a valid month
01843. 00000 - "not a valid month"
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,504
#2: Jun 18 '07

re: Conversion of date format


u only need to use the conversion functions properly with correct format.

next time post what u tried to solve this.
Newbie
 
Join Date: Jun 2007
Posts: 2
#3: Jun 18 '07

re: Conversion of date format


Hi,
I need to convert one date format to another. I am using the following query but is not working, can someone suggest the reson for the query not to work.

select TO_CHAR(trans_date,'YYYY-MM-DD HH24:MI:SS') as trans_date from ln_si_addr_ex_support
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,504
#4: Jun 18 '07

re: Conversion of date format


since i dont have the table ,i tried on my local emp table .

Its working fine

1* select TO_CHAR(hiredate,'YYYY-MM-DD HH24:MI:SS') as trans_date from emp
SQL> /

TRANS_DATE
-------------------
2002-01-01 03:45:45
1981-11-17 00:00:00
1981-05-01 00:00:00


r u storing date in the table in any other format

please specify.
Member
 
Join Date: Jun 2007
Posts: 50
#5: Jul 3 '07

re: Conversion of date format


Hi ! i need to concat three variable which contains the date,month and year respectively, then convert these string data into a Sql format date datatype,ie 103 format !
Kindly help me !
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,504
#6: Jul 3 '07

re: Conversion of date format


Quote:

Originally Posted by hellboss

Hi ! i need to concat three variable which contains the date,month and year respectively, then convert these string data into a Sql format date datatype,ie 103 format !
Kindly help me !

can you kindly post your sample code for my reference please.
Reply