Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 Article: Best Practices for Date/Time Calculations

Author  Topic 

Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-05-30 : 10:54:34


Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2007-05-30 : 11:02:30
My first comment is that this particular forum is for discussion of articles on this site :) Can you move your post to one of the other forums? Maybe the T-SQL forum? Thanks!


Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

Cybernetic Yak Master

11752 Posts

Posted - 2007-05-30 : 11:02:34
is it yours?

Causing trouble since 1980
Go to Top of Page

SQL Natt Alfen

3279 Posts

Posted - 2007-05-30 : 13:11:13
It's a good article. Deeper discussion on datetime type, and why the inbuilt functions should be used.
Maybe misses a point that the inbuilt functions are there for a purpose,
and that they will work even if the internal representation of datetime is changed.

Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-05-30 : 14:56:07
There are a lot of SQL Server date manipulations I see that make me cringe.

For example, this code to get today a midnight.
select convert(datetime,floor(convert(float,getdate())))

or this code to get the time without the date:
select convert(datetime,convert(varbinary(4),getdate()))

Go to Top of Page

- Advertisement -