Browse by Tags
All Tags »
SQL (
RSS)
Sorry, but there are no more tags available to filter with.
-
by David Leibowitz
| December 12, 2007
|
|
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...
|
-
by David Leibowitz
| December 11, 2007
|
|
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...
|