1

I have the date in the format of yy-mm-dd and I want to convert it to dd-mm-yyyy. I used the following select statement:

select  convert(varchar(30), hiredate, 110)
from emp;

But, I keep getting an error that there's a missing expression:

ORA-00936: missing expression

Can someone please guide me?

0

1 Answer 1

2

If the hiredate's data type is DATE, then use to_char function:

select to_char(hiredate, 'dd-mm-yyyy') from emp;

If the hiredate's data type is VARCHAR2 or CHAR, convert it to DATE by to_date then use to_char:

select to_char(to_date(hiredate, 'yy-mm-dd'), 'dd-mm-yyyy') from emp;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.