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
 General SQL Server Forums
 New to SQL Server Programming
 can somebody convert this string to time

Author  Topic 

khasim76
Starting Member

35 Posts

Posted - 2010-05-04 : 16:06:47

can somebody please convert this string to time. I have this timestamp in my database. i need to put a default timestamp which is in this string.
'9999-12-31 00:00:00.000'


Regards

Khasim Shaik

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-05-04 : 16:35:27
I am not clear on what you want. What do you mean by "put a default timestamp which is in this string"?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-05-07 : 04:03:55
Do you want to truncate time part when storing dates?

Madhivanan

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

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-05-07 : 04:37:11
CAST('9999-12-31 00:00:00' AS TIME)



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-05-07 : 05:13:12
If you want time part from this string then use
SELECT CONVERT(VARCHAR(12), CONVERT(DATETIME, '9999-12-31 00:00:00'), 108)

Vaibhav T

To walk FAST walk ALONE
To walk FAR walk TOGETHER
Go to Top of Page
   

- Advertisement -