By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,463 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,463 IT Pros & Developers. It's quick & easy.

Week number calculations

P: 19
Hi,

Suppose I have a date, is there some way I can use Access to calculate the week number the date is in? And if so, can Access take notice of leap years?

Thanks!
Oct 29 '06 #1
Share this Question
Share on Google+
4 Replies


Andrew Thackray
P: 76
the function is

week(YourDate)

Access automatically takes care of leap years
Oct 29 '06 #2

P: 19
the function is

week(YourDate)

Access automatically takes care of leap years
Thanks a lot!

Another question: can this be domne the other way around to? Can I access to give me, for example, the date of the first day of a week?
Oct 29 '06 #3

PEB
Expert 100+
P: 1,418
PEB
Hi,

So there is a function

Weekday(MyDate)

That can help you about

In fact there isn't function week() in Access...

The function for the week is:

Datepart("ww", Your Date)

:)
Oct 29 '06 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Hi,

So there is a function

Weekday(MyDate)

That can help you about

In fact there isn't function week() in Access...

The function for the week is:

Datepart("ww", Your Date)

:)
To expand on on PEB's post ...

DatePart ("ww", date)

returns the week number of any date, the default for week one is the week containing January 1st. The first day of the week defaults to sunday.

to get the day of the week of any date

Weekday (date) returns a number 1 to 7, 1 being sunday

WeekdayName (Weekday (date)) returns the week day name in Full

WeekdayName (Weekday (date), True) returns abbreviated week day name
Oct 29 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.