DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: How can i change set date format in sql2000 to dd/mm/yyyy????

  1. #1
    Daniel Guest

    How can i change set date format in sql2000 to dd/mm/yyyy????


    i need to change the date format in sql2000 to dd/mm/yyyy because when i run
    a sp it returns yyyy/mm/dd.
    thanks.

  2. #2
    Edwin Guest

    Re: How can i change set date format in sql2000 to dd/mm/yyyy????



    It looks like you want to convert the datetime value into a character value.
    The dates are all stored the same way in SQL Server but you can tell the
    SQL Server to convert that date to a char datatype.

    The Syntax is:
    CONVERT(datatype[(length [,scale])],expression [,style])

    The syntaxt for your case would be:

    convert(char(8),DATE,1)

    DATE being whatever that date field is in SQL Server.
    1 is the parameter that tells SQL how it should format the date.
    "Daniel" <----@----.---> wrote:


    >
    >i need to change the date format in sql2000 to dd/mm/yyyy because when i

    run
    >a sp it returns yyyy/mm/dd.
    >thanks.



  3. #3
    Join Date
    Apr 2006
    Posts
    1

    Thumbs up Re: How can i change set date format in sql2000 to dd/mm/yyyy????

    Hi Daniel,
    You can use SET DATEFORMAT on top of your scripts
    ie:

    SET DATEFORMAT dmy

    .....you codes....

    Francesco.
    Last edited by Francesco; 04-26-2006 at 11:40 AM.

  4. #4
    Join Date
    Oct 2006
    Posts
    1
    Hello Fransesco, the help of sql server says:
    "This setting is used only in the interpretation of character strings as they are converted to date values. It does not affect the display of date values."

    By, Jesus and the Virgin Mary bless us.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center