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 SkipVought 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 week to Monday

Status
Not open for further replies.

priac

Technical User
Feb 8, 2002
47
0
0
US
I have a report written in Access 2003. It defaults to Sunday as the first day of the week. I need it to be Monday. Can anyone help. I can't find how to change the default.
 
That is not very much information. What do you mean by the report defaulting? This could mean about 100 things. There are lots of date functions where you can specify the default first day of the week, but without some information I have no idea. At a minimum.
1) Provide the Sql recordsource for the report
2) Provide all code in question
 
I used the report wizard to create a report grouped by the week. The reports first day is Sunday, not Monday. I assumed the was a default setting for the wizard that could be changed to Monday.
 
Can not really help without seeing the SQL for the report. Here is the likely problem, but I can not tell you where it is. Somewhere in the query or the sorting and grouping is this function

Weekday(date, [firstdayofweek])

Where date is your field. In your query it would look like this
Weekday([yourFieldName])
Because the default is Sunday.
If you can find this function change to
Weekday([yourFieldName],vbMonday)
This sets to Monday.

This function returns a number 1 to 7. So if you put in a date that falls on monday and you put vbMonday as the second parameter it returns a 1 and a day that falls on Sunday returns a 7. But if you do not put in the second parameter it returns a 1 for Sunday and a 2 for Monday
 
When you choose a date field in the Sorting and Grouping, you have the opportunity to set the "Group On" to values like Year, Quarter, Month, Week, Day, etc. You can't set the week starting date in this dialog. You only need to subtract 1 from the date to group by weeks starting on Monday.

Set the Field/Expression to:
Code:
=[Your Date Field]-1

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top