hello,
i have start date and end date mentioned in excel i need to get week for that same week.
cehck below ss
here output is - week 5
so i need week number for above dates
how can i get that?
help m eon same
hello,
i have start date and end date mentioned in excel i need to get week for that same week.
cehck below ss
here output is - week 5
so i need week number for above dates
how can i get that?
help m eon same
May be try this approach.
Get week number for start and end date individual and then check if it’s the same or not. If same take that as week number else that would be going to be exception may be.
weekNumber = DatePart(DateInterval.WeekOfYear, DateTime.ParseExact("2025-01-26", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture), FirstDayOfWeek.Monday, FirstWeekOfYear.System)
Is your system calendar week start from Sunday?
Because 26 Jan is on Sunday hence it’s falling under week 4.
Check this one
weekNumber = DatePart(DateInterval.WeekOfYear, DateTime.ParseExact("2025-01-26", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture), FirstDayOfWeek.Sunday, FirstWeekOfYear.System)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.