Count the records per week

Hi guys,

Can someone please give the query syntax for counting the records of Field 1 per week (Field 2 with daily dates).
The week starts Monday.
Thank you
Who is Participating?
Dale FyeConnect With a Mentor Commented:
In Access, this might look like:

SELECT Year([Field2]) as TransYear, DatePart("ww", [Field2]) as TransWeek, Count(*) as WeekCount
FROM yourTable
GROUP BY Year([Field2]) as TransYear, DatePart("ww", [Field2]) as TransWeek
Jared_SConnect With a Mentor Commented:
datepart(year,field2) as [year],datepart(week,field2) as [week], count(field1) as [Count]
from table
group by datepart(week,field2),datepart(year,field2)
order by datepart(year,field2), datepart(week,field2)
The access syntax that fyed posted will work in MS SQL too... no need for my re-post.
marian68Author Commented:
Thank you guys,
Yes the first query worked.
Thank you both
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.