--针对以上默认 7 对应星期日
DECLARE @Dt DATE='2017-07-23'
SELECT RTRIM(CASE WHEN DATEPART(dw,DATEADD(dd,-1,@Dt))>=5 THEN MONTH(DATEADD(dd,-7,@dt)) ELSE MONTH(@dt) END)+'月的第'
+RTRIM(CASE WHEN DATEPART(dw,DATEADD(dd,-DAY(@Dt),@Dt))>=5 THEN 0 ELSE 1 END+CASE WHEN DATEPART(dw,DATEADD(dd,-1,@Dt))>=5 THEN CEILING(DAY(DATEADD(dd,-7,@dt))/7.0) ELSE CEILING(DAY(@dt)/7.0) END)
+'周'