Convert date to week number

  • Thread starter Thread starter Jason Morin
  • Start date Start date
J

Jason Morin

Using Access2003...
Does Access have an equivalent of Excel's WEEKNUM
function, something that'll convert a date to a week
number? Preferably where the week begins on Monday? I
need to add an extra column in a query that contains
weeknum.
Thanks!
Jason
 
The VBA function DateDiff() has a variety of options for you to work with
dates.
Take a look at the help file. If this still does not answer your question,
please let me know.


--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Using Access2003...
Does Access have an equivalent of Excel's WEEKNUM
function, something that'll convert a date to a week
number? Preferably where the week begins on Monday? I
need to add an extra column in a query that contains
weeknum.
Thanks!
Jason

DatePart("ww", [datefield])

should help. Open the VBA editor and check out the various options
(i.e. the starting date) in the online help for DatePart.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Jason said:
Using Access2003...
Does Access have an equivalent of Excel's WEEKNUM
function, something that'll convert a date to a week
number? Preferably where the week begins on Monday? I
need to add an extra column in a query that contains
weeknum.
Thanks!
Jason

Jason, use the Format( ) function as follow:

Format([Date Field], "ww", vbMonday)

-Randy
 
Back
Top