Can I change the format in which Sql Server stores dates?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Can I change the format in which Sql Server stores dates?

  1. #1
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259

    Can I change the format in which Sql Server stores dates?

    Can I change the way that sql Server stores the dates for a single table's date column ?
    the usual format is mm/dd/yyyy but I want it to store it like : yyyy/mm/dd . Is this possible ?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    SQL Server does not store dates in a particular format. Why do you ask?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259
    Quote Originally Posted by Phil Weber
    SQL Server does not store dates in a particular format. Why do you ask?

    well its displaying the dates like : mm/dd/yyyy in the table, I want it to display the date as yyyy/mm/dd because the data has to be inserted to another table to create a csv file that has to have the date in that format because the csv file is going to get FTP'd and uploaded to an ORACLE db . (And no I cant just use dts because we cannot obtain permission to directly connect to the Oracle DB .
    Last edited by Matrix.net; 02-22-2007 at 10:11 AM.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    If you're using .NET code to insert the data into the Oracle database, you may do something like this to format the date as desired:

    ' dr is a SqlDataReader
    Dim DateValue As DateTime = dr.GetDateTime(ColNum)
    Dim NewFormat As String = DateValue.ToString(Format)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 4
    Last Post: 05-29-2001, 08:03 PM
  2. Access to SQL server
    By Nate in forum Database
    Replies: 29
    Last Post: 05-09-2001, 11:04 AM
  3. SQL Server Agent wont auto start
    By David Hay in forum Database
    Replies: 2
    Last Post: 04-02-2001, 08:11 PM
  4. myLittleAdmin SQL Server version
    By myLittleTools.net in forum web.announcements
    Replies: 0
    Last Post: 03-10-2001, 01:35 PM
  5. Re: ODBC error
    By Devaraj in forum Enterprise
    Replies: 0
    Last Post: 05-11-2000, 01:48 PM

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