Hi Kirk,
It can be simplified a little bit. See
http://www.berezniker.com/display/SQL/Week+number+in+a+month>
>Your right and this one you put together seems to do the trick. Thanks again for you time and knowledge.
>
>
>SELECT (DAY(@dt)
>+ (((8 -
> (1 + ((7 - (DATEPART(dw, DATEADD (month, DATEDIFF (month, 0, @dt), 0))-1)) % 7)) -- First Sunday
> ))%7)
>-1)/7 + 1
>
--sb--