This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Depending on which week Sundays are to be accounted in, you may need to make adjustments to address. the "%w" specifier is what returns an day number of week, which is a value between 0-6, starting on Sunday.
Here's a more complex formula that validates the day number. If it's 0 then change to 7 else keep value.
The first example I provided hard coded the date in the first argument of DATETIMEADD. simply replace that with the field it needs to reference. On the code I attached here, you'd need to replace all the "[Date]" with your field name (illustrated below).
I actually tried to do month end just now and realized I had no idea how to do it either. I'm a total SQL noob. Basically what I'm trying to do for month end is...
If I have 2016-11-29 as a date (and thousands of other dates with varying days and months and years), I would like the formula to give me the month end of that particular date. So in this case, it would show 2016-11-30.