Formatting date to week

S

shiro

Hi All,
I'm trying to create a select query which have field date.
Now I want have a field which return the date value to
week format.How to create it.I want the week change
every monday at 7.30 am.How to make access achieve
it.Hope somebody like to help.
 
J

Jerry Whittle

If by "week format" you mean the number of the week, something like below
will work somewhat:

TheWeekNumber: DatePart("ww", [TheDateField], vbMonday)

It does not take into account your need for it starting at 7:30am. If the
date field has a time element, something like this may meet your needs:

TheWeekNumber: DatePart("ww", [TheDateField] - 0.3125, vbMonday)
 
S

shiro

Dear Jerry,
more explanation please.Can't we build it by using
exspression builder.Coding is terrible for me.


Jerry Whittle said:
If by "week format" you mean the number of the week, something like below
will work somewhat:

TheWeekNumber: DatePart("ww", [TheDateField], vbMonday)

It does not take into account your need for it starting at 7:30am. If the
date field has a time element, something like this may meet your needs:

TheWeekNumber: DatePart("ww", [TheDateField] - 0.3125, vbMonday)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

shiro said:
Hi All,
I'm trying to create a select query which have field date.
Now I want have a field which return the date value to
week format.How to create it.I want the week change
every monday at 7.30 am.How to make access achieve
it.Hope somebody like to help.
 
Top