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 2000 Forums
 Transact-SQL (2000)
 Separating date and time

Author  Topic 

TheCloser
Starting Member

2 Posts

Posted - 2004-07-27 : 09:04:56
im new to SQL and dba-ing. im trying to figure out how to separate a date/time field from a table into 2 separate fields: date for 1 and time of day for the other. so instead of the entire field being 5/4/2004 10:17:00AM, i would like one to be 5/4/2004 and another to be 10:17:00AM. any help would be great. thanks

[]TheCloser[]

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-27 : 09:09:25
Why would you do that? You can store them as VARCHAR, but I really can't think of a reason to just have two fields instead of 1 if you're storing both anyway.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

TheCloser
Starting Member

2 Posts

Posted - 2004-07-27 : 09:20:17
its funny as soon as you replied i realized that i can format out either date or time in Crystal. I thought if one instance was formatted then they both would be. So your very right its better to keep them together. Thanks a lot.

[]TheCloser[]
Go to Top of Page
   

- Advertisement -