If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
group by weekly date
I have data by log date and I want my query to group calls by week Mon thru
Sun. I also want to do by month. Is there a way to set that up? thanks Log Date 02/03/2008 02/05/2008 02/05/2008 02/05/2008 02/05/2008 02/06/2008 02/06/2008 02/07/2008 02/07/2008 02/07/2008 02/07/2008 02/08/2008 02/08/2008 02/08/2008 02/08/2008 02/09/2008 02/09/2008 02/10/2008 02/11/2008 02/11/2008 02/11/2008 02/11/2008 02/11/2008 02/11/2008 |
#2
|
|||
|
|||
group by weekly date
JRS wrote:
I have data by log date and I want my query to group calls by week Mon thru Sun. I also want to do by month. Is there a way to set that up? thanks Log Date 02/03/2008 02/05/2008 02/05/2008 02/05/2008 02/05/2008 02/06/2008 02/06/2008 02/07/2008 02/07/2008 02/07/2008 02/07/2008 02/08/2008 02/08/2008 02/08/2008 02/08/2008 02/09/2008 02/09/2008 02/10/2008 02/11/2008 02/11/2008 02/11/2008 02/11/2008 02/11/2008 02/11/2008 The DatePart function is probably going to work best to accomplish both. DatePart(interval, date[,firstdayofweek[, firstweekofyear]]) Example from MS Access help is below Dim TheDate As Date ' Declare variables. Dim Msg TheDate = InputBox("Enter a date:") Msg = "Quarter: " & DatePart("q", TheDate) MsgBox Msg |
Thread Tools | |
Display Modes | |
|
|