How do I get the date for the first and last day of the week, and the first and last day of last week?
Calculate first and last day of week
Collapse
X
-
FirstDayOfCurre ntWeek = SomeDate-(weekday(SomeDa te)-1)
FirstDayOfPrevi ousWeek = SomeDate-(weekday(SomeDa te)-1)-7
LastDayOfCurren tWeek = SomeDate - Weekday(SomeDat e) + 7
LastDayOfPrevio usWeek = SomeDate - Weekday(SomeDat e)
You can enter an actual date for SomeDate or use Date() to base this on today when run.
Welcome to TheScripts!
Linq ;0)>Comment
-
Hi, can you help me here, I'm trying to start the same one but with start day next Sunday and the end date end next week on Saturday in the format of dd.mm.yyyy. As I'm connecting this to sap script.
Can you assist here?Comment
Comment