Goup Data by a Custom Week

  • Thread starter zaps via AccessMonster.com
  • Start date
Z

zaps via AccessMonster.com

Hi Everyone,

I need some help here. I would like to group my data by week. ie Week 1,
Week 2, Week 3 etc. I can use the DatePart function to get the week number,
but the only problem is my week begin on Friday. Example: Week 1 = Dec 29,
2007 - Jan 4, 2008 Week 2 = Jan 5-11, 2008 Week 3 = 12-18, 2008. Is there
an easy way I can adjust the DatePart function is return week numbers
matching my crazy weeks?

Thanks,
Julie
 
J

John Spencer

Datepart does have two optional arguments. Did you try them?

I'm not sure that they are going to help you. BUt you could try playing with
them.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
M

Marshall Barton

zaps said:
I need some help here. I would like to group my data by week. ie Week 1,
Week 2, Week 3 etc. I can use the DatePart function to get the week number,
but the only problem is my week begin on Friday. Example: Week 1 = Dec 29,
2007 - Jan 4, 2008 Week 2 = Jan 5-11, 2008 Week 3 = 12-18, 2008. Is there
an easy way I can adjust the DatePart function is return week numbers
matching my crazy weeks?

Have you tried using the DatePart function's firstdayofweek
and firstweekofyear arguments?
 
R

Ron2006

If your table is going to contain data from different years then don't
forget to add the YEAR of the record into the sort and/or selection
criteria. If you do not then week 52 of last year will sort later in
your listing than week 2 of this year and this could be confusing to
your user or to your reporting program.
 
Top