Change Definition of week

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

Please help

I want to define the week as being Tuesday through Monday (i.e. first day of
the week as Tuesday and the last daty Monday)

Can I do something at a global level that will redfine the week for all
existing queries and VB Code, or do I have to change every peive of cod
ethat references the dayof week?
 
Depends upon what code you're using.... and what you mean by "Define the
week" with respect to what your database does....
 
This will define the first day of the week as Tuesday:
DatePart("w", Date, vbTuesday)
We need more information for youe code.
 
Please help

I want to define the week as being Tuesday through Monday (i.e. first day of
the week as Tuesday and the last daty Monday)

Can I do something at a global level that will redfine the week for all
existing queries and VB Code, or do I have to change every peive of cod
ethat references the dayof week?

You will need to find each date function (e.g. DatePart, WeekDay) for
which the week is relevant and insert the optional first day of week
operand. See the online help for DatePart in the VBA editor Help file
for details. I don't think there's any way to do it globally.

John W. Vinson[MVP]
 
Thaanks for the response. I use DATEPARTS and DATEADDs throughout the code,
but I do not want to change EVERY piece of code. I want to globally tell MS
Access to firstday of the week is now Tuesday.

Is there maybe an API call or some other global manner I can use to do this?
 
Thaanks for the response. I use DATEPARTS and DATEADDs throughout the code,
but I do not want to change EVERY piece of code. I want to globally tell MS
Access to firstday of the week is now Tuesday.

Is there maybe an API call or some other global manner I can use to do this?
 
I don't believe so. The "first day of the week" is an argument in these
functions, and they default to Sunday if no argument is given.


--

Ken Snell
<MS ACCESS MVP>
 
Back
Top