Out of curiousity,
Why use a function with additional overhead when
DatePart("ww",[DateField],1,1) will do?
Just trying to understand,
Mitch
--- In [email protected], "A.D.Tejpal" <[EMAIL PROTECTED]>
wrote:
> marc,
>
> Assuming you have a date type field, DateDiff() function
applied with reference to first of the year, should get you week of
the year.
>
> Sample query grouping the sales on weekly basis is give below.
In table T_Data, fields named SDate and Qty represent date of sale
and quantity sold respectively. (first week starts on first of the
year).
>
> Best wishes,
> A.D.Tejpal
>
> ===================================
> SELECT DateDiff("ww",DateSerial(Year([SDate]),1,1),([SDate]+1)) AS
SaleWeek, Sum(T_Data.Qty) AS SoldInWeek
> FROM T_Data
> GROUP BY DateDiff("ww",DateSerial(Year([SDate]),1,1),([SDate]+1));
> ===================================
>
> ----- Original Message -----
> From: [EMAIL PROTECTED]
> To: [email protected]
> Sent: Tuesday, August 30, 2005 03:59
> Subject: [AccessDevelopers] Group by week
>
> I have a query that displays data that I would like to group by
week. I don't even really care how the week is defined as long as it
is constant. ie, sun- sat, mon - sun.
>
> I am not really that familiar with the date functions and did
not see one that seemed to help.
>
> thanks.
>
> marc
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~->
Please zip all files prior to uploading to Files section.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AccessDevelopers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/