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)
 Don't truncate SmallDATETIME

Author  Topic 

hornet
Yak Posting Veteran

96 Posts

Posted - 2006-08-14 : 09:38:17
Hi all! I need to get SMALLDATETIME with hours, seconds and minutes.
I use
select CONVERT(SMALLDATETIME, (DATEDIFF(day, 2, TimerDate))) from or
TimerDate- SMALLDATETIME
but I'm getting truncatted TimerDate with 0 hours, minutes and seconds.
Also i've used CONVERT(SMALLDATETIME, (DATEDIFF(day, 2, TimerDate)), 20) but without a result
Why?

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-08-14 : 09:52:57
Keep in mind that SmalldateTime doesn't have accuracy for seconds.

see: http://msdn2.microsoft.com/en-us/library/ms187819.aspx



- Jeff
Go to Top of Page
   

- Advertisement -