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
 SQL Server Development (2000)
 Storing Time in SQL datetime column

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-06 : 10:05:15
Anil writes "I am attempting to store a Time value such as '8:00 AM' in a datetime column in SQL Server 7.0. When I use the Enterprise Manager to update the column, the data is properly stored. If I pass the time through a stored procedure to be stored in the database, the data is stored as '1/1/1900 8:00 AM'. Does anyone have any ideas?"

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2001-12-06 : 10:07:59
SQL Server only stores dates and times together. If you send only the time in, it will store it as SQL's base date (1/1/1900) plus the time.

Best bet is to send in both the date and time and adjust the display of the client to only display the time.

Go to Top of Page
   

- Advertisement -