Skip to main content
Solved

Calcuulate date based on weekday

  • May 2, 2023
  • 3 replies
  • 33 views

Forum|alt.badge.img+3

Hello,

I need to calculate a date. Here is an example:

Start date of employee is 2023-05-03. The previous Monday, an email should be sent to the employee.

How can I calculate the date based on the weekday.

I have a formula, but it only works if employee starts on a Monday


Cheers

Best answer by mushi4ka

We found this as a solution:

dateadd({Start Date}, (-6-WEEKDAY({Start Date})), 'days')

3 replies

Forum|alt.badge.img+3
  • Author
  • New Participant
  • 2 replies
  • May 2, 2023

This is my formula:

DATETIME_FORMAT(DATEADD({Start Date}, -7, 'days'), 'YYYY-MM-DD')


Jason_Hill
Forum|alt.badge.img+13
  • Inspiring
  • 40 replies
  • May 2, 2023

This is my formula:

DATETIME_FORMAT(DATEADD({Start Date}, -7, 'days'), 'YYYY-MM-DD')


DATETIME_FORMAT(DATEADD({hire date}, 0 - MOD(DATETIME_DIFF({hire date}, '2022-05-08', 'days'), 7) + 1, 'days'), 'M/D/YYYY')


Forum|alt.badge.img+3
  • Author
  • New Participant
  • 2 replies
  • Answer
  • May 5, 2023

We found this as a solution:

dateadd({Start Date}, (-6-WEEKDAY({Start Date})), 'days')