Question

How do i convert a Short date to a long date in Oracle SQL? for example.......

How do i convert a Short date to a long date in Oracle SQL?

for example.... Convert 09/12/2015 to show as 12th September, 2015

Homework Answers

Answer #1
date_field is given by to_date

TO_DATE('09/12/2015', 'DD/MM/YYYY')
The conversion of the format is done by to_char which changes the format of the date

select trim(to_char(date_field, 'dd')) || 'th ' || to_char(date_field,'month, yyyy')
  from ...

so the final query would be

select trim(to_char(TO_DATE('09/12/2015', 'DD/MM/YYYY'), 'dd')) || 'th ' || to_char(TO_DATE('09/12/2015', 'DD/MM/YYYY'),'month, yyyy') from ...

if you use 'Month' in to_char it right pads to 9 characters; we have to use the abbreviated 'MON', or to_char then trim and concatenate

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How do you delete a table using SQL? 3. What are the common data types used to define columns using SQL? 4. Identify the best data type to use to store the following data in Oracle, in SQL Server, and in Access:    a. The month, day, and year that an employee was hired    b. An employee’s Social Security number    c. The department...
Oracle: It keeps saying error in line 1, how do I fix it: --DROP TABLE DROP...
Oracle: It keeps saying error in line 1, how do I fix it: --DROP TABLE DROP TABLE Inventory; DROP TABLE Orders; DROP TABLE Order_Line; DROP TABLE Item; DROP TABLE Order_Source; DROP TABLE Category; DROP TABLE Customer;
How do I convert volume % to volumetric flow rate? This is occurring in a disitillation...
How do I convert volume % to volumetric flow rate? This is occurring in a disitillation column. I have the volume amount poured into the tank, 10L that is 7% methanol. I have a power input of 1.5 kW. I understand the mass balance of a distillation column. What I am confused about is after I found in the distillate, the 1 microliter sample is 5% methanol and 95% water at 5 minutes, how do I conver this to volumetric...
If I have 500 acres of land, how do I convert to the unit measurement of...
If I have 500 acres of land, how do I convert to the unit measurement of acre-feet?
Hi, in MATLAB how do you convert date and time (dd-mm-yy mm:ss:S) into time only (mm:ss.S)?
Hi, in MATLAB how do you convert date and time (dd-mm-yy mm:ss:S) into time only (mm:ss.S)?
Hi, in MATLAB how do you convert date and time (dd-mm-yy mm:ss:S) into time only (mm:ss.S)?
Hi, in MATLAB how do you convert date and time (dd-mm-yy mm:ss:S) into time only (mm:ss.S)?
3. How many people have the last name King Use PL/SQL? Code: Output: 4. Change the...
3. How many people have the last name King Use PL/SQL? Code: Output: 4. Change the first name to Stephen for the person with the last name King Use PL/SQL. Code: Output: Copy the record showing name change: Code: Output: 5. Delete all employees in Department 20. Use %TYPE for the variable. Use SQL%ROWCOUNT to see how many records were deleted. Code: Copy output showing ROWCOUNT: 6. Use a merge to merge the original employees table into emp_test. Do UPDATE...
How do I convert volume % to volumetric flow rate? I have the volume amount of...
How do I convert volume % to volumetric flow rate? I have the volume amount of the sample. This is for a disitllate of a disitllation column. I also have the density of each compound at the given temperature ( water and methanol).
How to convert kmol/h to kg/h? Please show me that by an example etc.
How to convert kmol/h to kg/h? Please show me that by an example etc.
How do I convert a thermal conductivity given as 72 Watts per meter times Kelvin to...
How do I convert a thermal conductivity given as 72 Watts per meter times Kelvin to Watts per meter squared times Kelvin to the fourth?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT