Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change First day of the week to Monday

Status
Not open for further replies.

Joshman

Instructor
May 24, 2000
13
US
How do I change the first day of the week to Monday for all calculations in Access?

Thanks,

Joshman


joshuab@musician.org
joshuaweb.htmlplanet.com
 
Joshman,

The first day of the week is not a setting in Access however you can use code in your calculation to make Monday the first day.

Please provide an example.




Bill Paton
william.paton@ubsw.com
Check out my website !
 
I am trying to show the appointments for the current week using the datepart() function. Right now it works great, but my client wants the "current week" to be Monday through Sunday.
I have a new field in a query calculating the Datepart of the [ApptDate] field: DatePart("ww",[ApptDate])
with the criteria being: DatePart("ww",Date())
I just need Access to think that the current week is Monday through Sunday.

Thanks,

Joshman



joshuab@musician.org
joshuaweb.htmlplanet.com
 
DatePart(interval, date[,firstdayofweek[, firstweekofyear]])

The DatePart function syntax has these named arguments:

Part Description
interval Required. String expression that is the interval of time you want to return.
date Required. Variant (Date) value that you want to evaluate.
firstdayofweek Optional. A constant that specifies the first day of the week. If not specified, Sunday is assumed.


So you need:

DatePart("ww",[ApptDate],vbMonday)

etc.



Bill Paton
william.paton@ubsw.com
Check out my website !
 
I can't believe it was so easy. Thank you much.

Joshua


joshuab@musician.org
joshuaweb.htmlplanet.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top