Forum Discussion

QuickbaseAdmin4's avatar
QuickbaseAdmin4
Qrew Member
2 years ago

Formula For Looking At The Last Thursday

Hello,

I am attempting to build a date formula that will always refer to the last occuring Thursday.

E.g., if today is Sunday-Wednesday, the formula will return the date for the Thursday of last week. If today is Thursday-Saturday, the formula will return the date for the Thursday of the current week.

Thank you!

------------------------------
Quickbase Admin
------------------------------

3 Replies

  • To sort any confusion, I am not an admin of QuickBase. This is the name of our administrative QuickBase account in our organization that handles all pipelines and webhooks. Hope I am not setting any false assumptions!

    ------------------------------
    Quickbase Admin
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      Try this formula.  Replace [My Date Field] with your own field. 

      var date LastThursday = FirstDayOfWeek([My Date Field])-Weeks(1) + Days(4);
      var date CurrentThursday = $LastThursday + Weeks(1);

      If(
      DayOfWeek([My Date Field])<=3, $LastThursday,
      DayOfWeek([My Date Field])>=4, $CurrentThursday)



      //E.g., if today is Sunday-Wednesday, the formula will return the date for the Thursday of //last week. If today is Thursday-Saturday, the formula will return the date for the //Thursday of the current week.

      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------
      • QuickbaseAdmin4's avatar
        QuickbaseAdmin4
        Qrew Member
        Thank you Mark, that worked perfectly!

        ------------------------------
        Quickbase Admin
        ------------------------------