Current week number in report header (1 Viewer)

ROSEK

New member
Local time
Today, 05:46
Joined
May 29, 2021
Messages
7
I am looking to add the current week number to the header of a report. I know =Date() will return today's date but I am looking to convert that to a week number

I tried =DatePart("ww",Date()) in a text box on the report but it is not working. Any suggestions?
 

Minty

AWF VIP
Local time
Today, 09:46
Joined
Jul 26, 2013
Messages
10,355
DatePart("ww",Date()) is correct - if i type it into the immediate window I get

Code:
? DatePart("ww",Date())
 24

What isn't working - what are you getting?
 

ROSEK

New member
Local time
Today, 05:46
Joined
May 29, 2021
Messages
7
Minty,

Not sure what was going on. It is now working. Crazy Monday morning issues
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:46
Joined
Oct 29, 2018
Messages
21,358
Hi. Just FYI, The DatePart() result is not the same as ISO week number, if that matters to you.
 

ROSEK

New member
Local time
Today, 05:46
Joined
May 29, 2021
Messages
7
Hi. Just FYI, The DatePart() result is not the same as ISO week number, if that matters to you.
Not sure it will really matter for my application, thought I am not sure what the difference is
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:46
Joined
Oct 29, 2018
Messages
21,358
Not sure it will really matter for my application, thought I am not sure what the difference is
If you're not thinking about it, it probably doesn't matter to your situation. But just to demonstrate the difference, try the following in Access.
Code:
DatePart("ww", #6/7/2021#)
Then, try the following in Excel and compare the results.
Code:
ISOWEEKNUM("6/7/2021")
 

Users who are viewing this thread

Top Bottom