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 -----
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



Please zip all files prior to uploading to Files section.




SPONSORED LINKS
Microsoft access developer Microsoft access help Microsoft access database
Microsoft access training Microsoft access training course Microsoft access programming


YAHOO! GROUPS LINKS




Reply via email to