Topic
6 replies Latest Post - ‏2013-10-24T15:59:19Z by Archanaa
Archanaa
Archanaa
7 Posts
ACCEPTED ANSWER

Pinned topic same week time last year

‏2013-10-21T22:09:26Z |

Hi,

How can I subtract 52 weeks from current date. The pupose is, I want to go back  to the same week day last year and use that date in calculations.

for ex. if today is 2013-10-21, same week day last year date will be 2012-10-22.

Any thoughts?

 

 

 

  • paulhospers
    paulhospers
    4 Posts
    ACCEPTED ANSWER

    Re: same week time last year

    ‏2013-10-22T15:01:26Z  in response to Archanaa

    How about

    current date - 1 year

    or

    current date - 12 months

     

    • Archanaa
      Archanaa
      7 Posts
      ACCEPTED ANSWER

      Re: same week time last year

      ‏2013-10-22T16:19:23Z  in response to paulhospers

      This will take me back to the same date last year. I want to go back to same week day of last year.

      Let's say today's date '2013-10-22' is a tuesday in 41st week. So, I want to get a date for a Tuesday in 41st week of last year.

       

      Thanks,

      • B.Hauser
        B.Hauser
        248 Posts
        ACCEPTED ANSWER

        Re: same week time last year

        ‏2013-10-23T07:56:07Z  in response to Archanaa

        You may try something like this:

        Values(Next_Day(Current_Date - 1 Year, DayName(Current_Date));

        Birgitta

         

         

        • Archanaa
          Archanaa
          7 Posts
          ACCEPTED ANSWER

          Re: same week time last year

          ‏2013-10-23T16:02:29Z  in response to B.Hauser

          Yesterday I tried (Current Date -364 days). I tested it and looks like it is working. Can you think of any drawbacks in using it.

          Thank You for the replies.

           

          • B.Hauser
            B.Hauser
            248 Posts
            ACCEPTED ANSWER

            Re: same week time last year

            ‏2013-10-24T06:54:38Z  in response to Archanaa

            What about a leap year? Does it work correctly (I didn't test it out)

            Birgitta

            Updated on 2013-10-24T06:55:37Z at 2013-10-24T06:55:37Z by B.Hauser