• 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!