How to calculate the week number in MS Access?

  • Thread starter Thread starter Jesse
  • Start date Start date
J

Jesse

Dear Customer Service:

I know that I can use the function Weeknum in Excell to
calculate the week number for a date. But I could not
find the same function in MS Access 2000. How can I get
the build-in function for MS Access 2000 to calculate the
week number for a date?

Sincerely,

Jesse Huang
 
Thank you for choosing to use the Microsoft Public Newsgroup for Access.
We hope we can assist you.

Both of these functions from the Immediate Window yield 39 which is the current week number:

?Format(Date(),"ww")
39
?DatePart("ww",Date())
39

We hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Jesse,

Check out the DatePart function in Access. You can specify the string "ww" for the interval to
get a count of the weeks. You can also include optional parameters that specify the
FirstDayOfWeek (default is Sunday if not included) and FirstWeekOfYear (the one in which January
1 occurs, if not included).

Syntax
DatePart(interval, date[,firstdayofweek[, firstweekofyear]])

An example of using in a query, with an alias "WeekNum", for a field named "RDate":

WeekNum: DatePart("ww",[RDate])

Note: I recommend that you do not use the field name "Date", as this is a reserved word in
Microsoft Access.


Tom
______________________________________________
Dear Customer Service:

I know that I can use the function Weeknum in Excell to
calculate the week number for a date. But I could not
find the same function in MS Access 2000. How can I get
the build-in function for MS Access 2000 to calculate the
week number for a date?

Sincerely,

Jesse Huang
 

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

weekly report 5
Week number 1
Week numbers 2
Week number 3
Access Formula For Dates 4
Calculate the number of days in work week from start date to end d 3
week numbers 2
Week Number 2

Back
Top