Week number

B

Boon

Hello,

Is there a function in Access that do the same thing as 'Weeknum' in Excel?

I have a textbox that shows the current week number... so I'm thinking of
something like weeknum(date())..

Thanks
 
F

fredg

Hello,

Is there a function in Access that do the same thing as 'Weeknum' in Excel?

I have a textbox that shows the current week number... so I'm thinking of
something like weeknum(date())..

Thanks


=DatePart("ww",Date())
Todays week number is....
48
 
D

Douglas J. Steele

Just a comment. You got two different solutions: DatePart and Format.

Both work. The difference is DatePart returns a number, while Format returns
a string.

You may want to check the Help file, though, to find out about 2 optional
parameters that can be passed to both of the functions: firstdayofweek and
firstweekofyear.

firstdayofweek is a numeric value that specifies the first day of the week.
(1 is Sunday, 2 is Monday and so on until 7 is Saturday. You can also
specify 0, which means to use the System setting) If not specified, Sunday
is assumed.
firstweekofyear is a numeric value that specifies how the first week of the
year is determined. (1 means week 1 is the week in which Jan 1 occurs, 2
means it's the first week of the year that has at least 4 days, 3 means it's
the first week of the year that has 7 days and 0 means use the System
setting.) If not specified, it's assumed to be the week in which January 1
occurs.
 

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