Mladen Prajdić Blog

Blog about stuff and things and stuff. Mostly about SQL server and .Net

SQL Server Date and Time fun from all around

A few days ago Adam Machanic proposed a great idea about a T-SQL Tuesday. Every Tuesday there would be a topic bloggers all around would post about. Chosen as the first topic was the date and time stuff in SQL Server.

Because there’s already all this great content out there I’m not going to repeat it but I’m going to put together a ton of datetime resources from SQLTeam forums and blogs as a resource you can use in the future.

 

Michael Valentine Jones

MVJ as we like to call him in the forums has a thing for datetime manipulation. He has some really good helper functions he shared with the world.

 

Peter Larsson

Peter is an MVP who has the most amazing ideas for writing SQL. If you want performance talk to him.

 

Jeff Smith

Sometimes I think that Jeff is datetime machine. His posts are always high quality and simple to understand. He’s also an MVP who I hope will start blogging more again soon.

 

K H Tan

K H Tan is a smart fellow from Singapore who’s always glad to help. Shame he doesn’t blog.

  • fn_next_business_day - Calculates the next x business day (excluding Sat, Sun). Basically a businessdateadd() for dateadd()

 

Mladen Prajdić

In each post I learned something new or got a nice idea so it’s also worth reading the comments. On some issues my views have changed while on others they stayed the same.

Legacy Comments


Adam Machanic
2009-12-08
re: SQL Server Date and Time fun from all around
One correction: NOT every Tuesday. That would be way too much work for everyone :-) ... Only the 2nd Tuesday of each month.

Mladen
2009-12-08
re: SQL Server Date and Time fun from all around
really? not every tuesday? that's totally disappointing! :)

eyechart
2009-12-09
re: SQL Server Date and Time fun from all around
2nd tuesday corresponds to patch tuesday - that could also be pretty busy for a lot of people.



-ec

Adam Machanic
2009-12-09
re: SQL Server Date and Time fun from all around
eyechart: I was unaware of that--not an IT guy--and it is a good point, but it doesn't really matter. People can (and should) write blog posts in advance and schedule them to go live when they want them to. This will give bloggers, especially in IT, a chance to practice organizational skills :-)

John Sonmez
2009-12-09
re: SQL Server Date and Time fun from all around
Thanks for the useful links!

Jon H
2009-12-11
re: SQL Server Date and Time fun from all around
This might help users with reporting services. This link shows how to use date functions to set parameters inside of reporting services reports: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=99697

Enjoy