Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 how to change datetime format

Author  Topic 

jaimin
Starting Member

21 Posts

Posted - 2007-05-31 : 05:45:29
how to change datetime format.
i want to store datetime in my table as yyyy-mm-dd.
can it be done??

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-05-31 : 05:49:27
DATETIME is stored as a pair of 4-byte integers. Have a look at CONVERT if you want to present it in a certain way. Even better, if possible, try to format it in the presentation layer.

Mark
Go to Top of Page

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-05-31 : 06:47:34
Why you are worrying about the way the date is stored in the database and manipulate it while representing to the user.



--------------------------------------------------
S.Ahamed
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-31 : 09:35:43
1 Use proper DATETIME datatype to store dates
2 Dont worry how they are stored in a table
3 Let front end do the formation

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -