Solved Incorrect Week Number Being shown

Number11

Member
Local time
Today, 16:16
Joined
Jan 29, 2020
Messages
613
So Access is throwing out the report with the wrong week number., today 13.10.2022 is week 41 yet its showing as 42?

command used for naming the file is ...

.ActiveWorkbook.SaveAs ("C:\Reports\Zip\Sales Report Week " & Format(Date, "ww") & " " & Format(Date, "DD-MMM-YYYY") & ".xlsx")

output is..
1665645282719.png
 
i got same week number, 42
what is your expected week number?
 
I also get 42. Why do you expect 41?
 
Yeh fixed by using...

.ActiveWorkbook.SaveAs ("C:\Reports\Zip\Sales Report Week " & Format(Date, "WW", vbMonday, vbFirstFullWeek) & " " & Format(Date, "DD-MMM-YYYY") & ".xlsx")
 

Users who are viewing this thread

Back
Top Bottom