How to format the output date of a SQL query ?
-
-
Answer:
In Oracle, you have a function TO_DATE(char/date, 'fmt') if format is ommitted, format is DD-MON-YY for another format you can use: YYY or YY or Y Last 3, 2 or 1 digit of year. MM Month 2 digit value MONT Name of month padded with blanks to lengt of 9 characters. MON Name of month, 3 letter abreviation DDD, DD, D Day of year, month or week.
D at Yahoo! Answers Visit the source
Other answers
What format do you want and what database are you using?
HungryHunter
TO_CHAR(b, 'YYYY/MM/DD') this is a typical way...more formats can be found on the link below.
cscompguy
Use Convert(). It has a parameter that will allow you to format the date and return it as a string.
Kryzchek
Related Q & A:
- How can I optimize this dynamic SQL query in oracle with PL/SQL?Best solution by docs.oracle.com
- How to convert sql query to Hibernate Criteria query?Best solution by Stack Overflow
- How to convert a SQL query into hibernate criteria?Best solution by Stack Overflow
- How to present large dataset from a SQL Server query?Best solution by stackoverflow.com
- How to change column data's as a separate column wise format in a SQL Server?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.