group by week (M-Su)

H

Heather Vernon

How do I group the records in my report by week starting on Monday (e.g. M
7/11-Su 7/17) instead of starting on Sunday?
 
M

Marshall Barton

Heather said:
How do I group the records in my report by week starting on Monday (e.g. M
7/11-Su 7/17) instead of starting on Sunday?

Group on an expression like:

=DatePart("ww", yourdatefield, 2)

The 2 specifies Monday as the week start date. See Help for
details.
 
F

Fleone

Marshall, I have an additional but pertinent question. Is it possible to
alter the "starting week" for the year to reflect a fiscal calendar instead
of a standard calendar?
The code that I am using looks like this:
SELECT DatePart("ww",[sentdate],1) AS Week, Count(tbl_mytable.sentdate) AS
CountOfnum
FROM tbl_mytable
GROUP BY DatePart("ww",[sentdate],1);

I know that if I do not specify that constant for the <firstweekofyear>
argument that it defaults to the week that has January 1st.
Is there a way to have the function start at say October 1st instead? This
would synchronize the week number count that I have as a result with the
fiscal calendar that we use.
TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top