in

jetlounge

the minty fresh blog that whitens your teeth!


Syndication

Browse by Tags

All Tags » SQL (RSS)


Sorry, but there are no more tags available to filter with.
  • T-SQL: Get the Week Number of a Calendar Quarter

    by David Leibowitz | December 12, 2007 | Comments: 116

    A little more code in this function than the week number of month function. You can substitute the beginning quarter dates for something custom...like an Accounting Period for instance. declare @p_date smalldatetime set @p_date = '5/15/2007' --or any date you like select CASE WHEN datepart ( mm , @p_Date ) >= 1 and datepart ( mm , @p_Date...
  • T-SQL: Get the Week Number for a Given Month

    by David Leibowitz | December 11, 2007 | Comments: 116

    This function is fairly simple. Pass in a date and we return the Week # of the month. Generally this is 1 -5. In a rare case, like April 2006, this may stretch to 6. It can be customized for custom calendars. declare @p_date smalldatetime set @p_date = '5/15/2007' --or any date you like select datediff ( wk , cast ( cast ( datepart ( mm , @p_date...


Powered by Community Server (Non-Commercial Edition), by Telligent Systems