locked
Oracle Date Formating Null date as 00/00/0000 RRS feed

  • Question

  • User166505692 posted

    Hi All,
    How can I format the Null Dates in my Oracle SQL to 00/00/0000.
    I am using NVL function but it doesn't recognize the 00/00/0000 as the date format.
    Is there any Date Formating available in Orcle SQL which formats null date to 00/00/0000
    Thanks,
    msbyuva

    Hi All,


    How can I format the Null Dates in my Oracle SQL to 00/00/0000.

    I am using NVL function but it doesn't recognize the 00/00/0000 as the date format.


    Is there any Date Formating available in Orcle SQL which formats null date to 00/00/0000


    Thanks,

    msbyuva


    Monday, January 3, 2011 11:06 AM

Answers

  • User1224194097 posted

    Why don't you return that date as string

    TO_CHAR(NVL(datecolumn,'00/00/0000')) DateColumn

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 3, 2011 11:52 AM
  • User166505692 posted

    Can I format the DateColumn to MM-DD-YYYY in the Query itself ? Instead of MM-DD-YYY:HH:MM:SS, i need it in MM-DD-YYYY format. How can I ?


    Thanks,

    msbyuva

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 3, 2011 12:27 PM

All replies

  • User1224194097 posted

    Why don't you return that date as string

    TO_CHAR(NVL(datecolumn,'00/00/0000')) DateColumn

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 3, 2011 11:52 AM
  • User166505692 posted

    Can I format the DateColumn to MM-DD-YYYY in the Query itself ? Instead of MM-DD-YYY:HH:MM:SS, i need it in MM-DD-YYYY format. How can I ?


    Thanks,

    msbyuva

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 3, 2011 12:27 PM
  • User166505692 posted

    Hey Thanks,

    It helped..   I did SELECT NVL(to_char(test_date,'DD-MM-YYYY'), '00-00-0000') from DUAL



    Monday, January 3, 2011 12:44 PM