Link to home
Start Free TrialLog in
Avatar of aruku
aruku

asked on

Please help with Conversion function in sql

Hello everyone

I need to convert date with format mm/dd/yyyy to numeric nnnn format

char to varchar

in oracle sql query

Please help


Avatar of HainKurt
HainKurt
Flag of Canada image

select to_char(sysdate, 'fmYYYY') from dual

date does not have format, I mean datetime column in database...

can you please give example showing what are you tryin to do...
You need convert Date to Numeric Format like Excel used?...
Avatar of aruku
aruku

ASKER

For example 12/23/2008 must be  as 2008

i need to convert the date fromat to numeric and use right function


i need to convert a char value to varchar
Avatar of aruku

ASKER

In the database the dob is for example given as 12/23/2003 then after writing the query i need to get only
2003. The dob in date datatype and i need to convert it to numeric. I need to write in oracle
select to_number(to_char(sysdate, 'fmYYYY')) from dual
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aruku

ASKER

Can you please tell me the same way how to convert Char datatype to Varchar2 and numeric to Varchar2