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
 Transact-SQL (2005)
 data type date

Author  Topic 

ejoeyz_85
Yak Posting Veteran

54 Posts

Posted - 2008-01-12 : 15:07:33
When a date is stored in a db, it is represented with date/time. How can I
get just the date to be stored with no time?

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2008-01-12 : 18:19:59
You can't and you shouldn't. Displaying the date without the time should be done at the GUI level. Further, dates with a time of midnight are generally considered to be "whole" dates that need to time comparison.

--Jeff Moden
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-12 : 19:43:53
If really want to do that, you can convert datetime to char and take substring of it.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-01-13 : 09:09:43
http://weblogs.sqlteam.com/jeffs/archive/2007/08/29/SQL-Dates-and-Times.aspx

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -