Results 1 to 2 of 2

Thread: Date Conversion

  1. #1
    Join Date
    Jul 2013

    Date Conversion

    I have a requirement where i have to input the date as mm-dd-yyyy.
    Now in database i can fetch the date as yyyy-dd-mm.
    What conversion i have to make to fetch it as mm-dd-yyyy.

    For ex i am feching data as
    select * from table a where date = '2011-05-25'
    Now how sud i do the conversion so that i can enter the date for ex as '05-25-2011'
    I have tried as for ex
    select * from table a where to_char(to_date(date,'yyyy-mm-dd'),'mm-dd-yyyy')= '05-25-2011'
    but it is throwing error.
    Please help.


  2. #2
    Join Date
    Jun 2003
    This will depend on what database server you are using.
    Oracle? MySQL? SQLServer?
    Post your question in the relevant subforum.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts