5 Replies Latest reply on Jun 12, 2012 10:23 AM by kathryn.chrismer

    Last Week/Previous Week in a New Year

    Angelique Abbott

      I have a simple calculation to determine Current Week, Last Week and Previous Week based on TODAY. In the new year it no longer works properly due to the week number being less than one. Any suggestions on how to adjust the calculation to account for the new year? (Current Week = Week 1, Last week = Week 52, Previous Week = Week 51)


      CASE DATEPART('week', [BeginDate])

      WHEN DATEPART('week', TODAY())  THEN 'Current Week'

      WHEN DATEPART('week', TODAY()) - 1 THEN 'Last Week'

      WHEN DATEPART('week', TODAY()) - 2 THEN 'Previous Week'

      ELSE 'Older' END