How to output XML from a regular SQL query?

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

Was this solution helpful to you?

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

Just Added Q & A:

Find solution

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.