Date String

  • I have this where clause:

    where sales.fld_posting_date between DATEADD(wk, DATEDIFF(wk,0,getdate()-7), 0) and (DATEADD(wk, DATEDIFF(wk,0,getdate()), 0) -1)

    I need to get this same week from last year.

    Any help would be appreciated?

    seajoker

  • Change the getdate to dateadd(yyy, -1, getdate()

  • Thanks for the help, it works as I need it to.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply