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

Need some PWA help 0
Week Number 2
Get date for start of week 3
Show week number in Project Report 0
weekday last year 2
Year and Week Totals 2
Function for week number 5
Week 53 and Week 1 from a given date 2

Top