GRP68
Technical User
- Aug 8, 2012
- 6
I am trying to create a query which will take data from a table that has a date field, code field, reference Number field. Sample table:
reference Code Date
00856147 1 2012-01-03
00856165 1 2012-01-03
00856240 1 2012-01-03
00856338 1 2012-01-03
00856666 2 2012-01-04
00857499 2 2012-01-09
00858151 2 2012-01-10
00858220 2 2012-01-11
00858278 2 2012-01-11
00858563 2 2012-01-12
00858721 2 2012-01-12
00858774 2 2012-01-12
00858861 2 2012-01-12
00859009 2 2012-01-13
00859126 1 2012-01-14
This is what i would like to get: The count of codes that occured within each calendar week:
Code CodeOccurancesWithinWeek WeekBeginning
1 4 2012-01-02
2 1 2012-01-02
2 10 2012-01-09
So far i can do the grouping of the counts but only per day that is listed in the date field. Any suggestions would be appreciated.
GP
reference Code Date
00856147 1 2012-01-03
00856165 1 2012-01-03
00856240 1 2012-01-03
00856338 1 2012-01-03
00856666 2 2012-01-04
00857499 2 2012-01-09
00858151 2 2012-01-10
00858220 2 2012-01-11
00858278 2 2012-01-11
00858563 2 2012-01-12
00858721 2 2012-01-12
00858774 2 2012-01-12
00858861 2 2012-01-12
00859009 2 2012-01-13
00859126 1 2012-01-14
This is what i would like to get: The count of codes that occured within each calendar week:
Code CodeOccurancesWithinWeek WeekBeginning
1 4 2012-01-02
2 1 2012-01-02
2 10 2012-01-09
So far i can do the grouping of the counts but only per day that is listed in the date field. Any suggestions would be appreciated.
GP