Mar 05, 2018 09:28 AM
I’m wondering if there’s a formula that will return the date of a specific weekday, such as Monday, relative to a set date field. Any ideas?
Mar 05, 2018 10:10 AM
You can use DATETIME_FORMAT({Field with datetime}, 'dddd')
to return Monday, Tuesday, etc. For more info on this, check out this support article on format specifiers for DATETIME_FORMAT.
Mar 07, 2018 09:04 AM
Sorry, I don’t think I was clear–what I meant was, let’s say this record is dated 3/7/18. I’d like to calculate the date of the Monday of that week. In this case, it would be 3/5/18. I did just discover the “WEEKNUM()” function, and that helps to an extent, but could it be combined with others to do this task? Thanks!
Sep 24, 2018 01:01 AM
Try this:
DATEADD(date, 1-IF(WEEKDAY(date)=0, 7, WEEKDAY(date)), 'day')