Quantcast
Channel: Answers for "Adding a weekending column to a fiscal calendar."
Browsing latest articles
Browse All 8 View Live

Answer by dbishop211

To have the week end on a Friday, use the following. To have it end on a Saturday, remove the "+ 1". To have it end on a Sunday, change "+ 1" to "- 1" UPDATE Fiscal SET FiscalWeekending = DATEADD(DAY,...

View Article



Answer by dbishop211

I added a comment but looks like it didn't post. It looks like your week ends on Sunday. I've checked my code, and it is not working correctly for Sunday EOW. Let me play around and I'll post the...

View Article

Answer by jdasupport123

Removing the +1 add the end of the datepart calculation fixed it. DATEADD(DAY, (7 - (DATEPART(DW, CalendarDate))), CalendarDate)

View Article

Answer by dbishop211

Okay, the following should work for Sunday as the last day of the week. DATEADD(DAY, CASE WHEN DATENAME(DW, CalendarDate) = 'Sunday' THEN 0 ELSE 7 - ((@@DATEFIRST - 1 + DATEPART(DW, CalendarDate )) %...

View Article
Browsing latest articles
Browse All 8 View Live




Latest Images