here's the code to get the first sunday of this month;
the last sunday of the previous month is the same date minus 7 days.
you could change the code to get the first Saturday of a given month,a dn then subtract 7 days;
--first sunday of this month....
-1=sunday,-2=saturday,-3-friday etc
SELECT
datename(dw,dateadd(dd,-1,DATEADD(wk,
DATEDIFF(wk,0,dateadd(dd,7-datepart(day,getdate()),getdate())), 0))),
dateadd(dd,-1,DATEADD(wk,
DATEDIFF(wk,0,dateadd(dd,7-datepart(day,getdate()),getdate())), 0))
Lowell