find last week of a year

K

Keesb

I have a field [HourDate]. I need to find what is the last possible week for
the year of the date in that field.
I'm using DatePart("ww", [HourDate], 2, 0) to get the week out of that date.

So the answer will always be 52 or 53. (f.e. the year 2009 has 53 weeks)

How can I do so in VBA?

Kees
 
J

John Vinson

I have a field [HourDate]. I need to find what is the last possible week for
the year of the date in that field.

Try:

Format(DateSerial(Year([HourDate]), 12, 31), "ww")

John W. Vinson[MVP]
 
K

Keesb

That will do.

Thanks

Kees

John Vinson said:
I have a field [HourDate]. I need to find what is the last possible week
for
the year of the date in that field.

Try:

Format(DateSerial(Year([HourDate]), 12, 31), "ww")

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Week Number 2
Get date for start of week 3
Year and Week Totals 2
Function for week number 5
Get Start date of Week number and Year 10
DatePart returning week 2
Datepart year 2004 vs. 2005 1
Week Number Format 4

Top