View Single Post
  #6  
Old May 28th, 2010, 08:07 PM posted to microsoft.public.access
Alaska1
external usenet poster
 
Posts: 46
Default Displaying dates by weeks in Report

Thank you it work and i can group on the week but in a report it will read
2010-21

"KARL DEWEY" wrote:

Is that a built in function in access?

Yes.
Format([YourDateTimeField], "yyyy-ww")

For the following dates you get --
entrydate Year-Wk
5/22/2010 2010-21
5/23/2010 2010-22
5/24/2010 2010-22
5/25/2010 2010-22
5/26/2010 2010-22
5/27/2010 2010-22
5/28/2010 2010-22
5/29/2010 2010-22
5/30/2010 2010-23
5/31/2010 2010-23

This is based on Sunday being the first day of the week but some payroll
systems have the week starting on other days.

To use week starting on Saturday use this --
Format([entrydate]+1,"yyyy-ww")

--
Build a little, test a little.


"Alaska1" wrote:

Is that a built in function in access?

"Tom van Stiphout" wrote:

On Fri, 28 May 2010 06:10:01 -0700, Alaska1
wrote:

I use a function that turns a date into a weeknumber in the format
yyyy-ww, which I can then group by. The function uses the Format
function to do this conversion.

-Tom.
Microsoft Access MVP


I have to display data by weeks in a report. What is the best way to do it?

weeks
5/24/2010 - 5/28/2010 5 time sheets returned
.