Convert date to week number

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
 
R

RobFMS

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

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
J

John Vinson

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
 
R

Randy

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
 

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

Top