anmita
1
How can we calculate the week for current week , last week and last to Last week but Week no Start should change
For Example Week 1 : Starts on March 1st 2022
So accordingly the week No should be calculated for Current week , Last Week No and Second Last Week
Yoichi
(Yoichi)
2
Hi,
How about the following expression?
startDate = New DateTime(2022,3,1)
targetDate = New DateTime(2022,8,24)
Then
(CInt(Math.Floor((targetDate-startDate.AddDays(CInt(-1*startDate.DayOfWeek))).TotalDays)) \7)+1
If you need last week number and last second week number, try to subtract 1 or 2 from the above.
Regards,
1 Like
Yoichi
(Yoichi)
4
Hi,
Is there any problem?
What approach do you need?
Regards,
anmita
5
Actually I am getting Error could you share xml if possible.
Yoichi
(Yoichi)
6
HI,
Here you are.
Sample20220825-4.zip (2.3 KB)
Regards,
anmita
7
Thanks @Yoichi for your quick response
Regards,
@anmita
1 Like
system
(system)
Closed
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.