Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group by Week or Month

Status
Not open for further replies.

Trishuli

Technical User
May 16, 2010
8
AU
Hi,

I need a formula which allows the date to be grouped monthly or weekly based on the parameter. I have tried everything and hardly found any information for date to be grouped weekly. I think there is a month(x) to change it to month..but no WEEK!!! why?? :(

Thanks!
 
YOu can use datepart() to return week number.

DatePart ("ww", currentdate) returns 34

You can replace current date with your datefield.

Ian

 
If you want to be able to format the resulting field to "Jan 2010" or "8/15/10", then you could use a formula like the following to group on:

if {?Interval} = "Monthly" then
{table.date}-day({table.date})+1 else
if {?Interval} = "Weekly" then
{table.date}-dayofweek({table.date}) + 1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top