A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

group by weekly date



 
 
Thread Tools Display Modes
  #1  
Old July 22nd, 2008, 08:00 PM posted to microsoft.public.access.queries
JRS
external usenet poster
 
Posts: 38
Default 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  
Old July 22nd, 2008, 08:52 PM posted to microsoft.public.access.queries
dustinbrearton
external usenet poster
 
Posts: 1
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.