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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping by Date but week ending !

Status
Not open for further replies.

Monkeyboy126

IS-IT--Management
Dec 9, 2002
47
GB
I have a report that displays daily data. The first column is obviously date and when grouped by "For each week), Crystal will group by a week commencing date and show the next 7 days.

I need the opposite and for Crystal to display a grouped date but for the week preceeding. So a date of 1/1/03 would group on last 7 days gone by.

I hope this makes sense because I'm quickly going grey and my hair is starting to fall out...

Many thanks
 
Think about it as looking more distinguished... :eek:)

Here are a couple of options:

1. Create a formula that adds 7 days (for example, using the DateAdd function) to the date field and present it in the Group Footer instead of the default Group Name.

2. Present the data using a CrossTab. When you click on "Group Options" for the date field in the CrossTab, Crystal provides a special DropDown that lets you pick what would be shown on the report: the Last Date in the Period or the First Date in the Period.

I don't know the answer to your next question -- why CrossTabs have this option and regular reports don't?

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
From one distinguished gentlemen to two others, I've learnt that grey is the color caused by teenage children. It is so we can't go with them to any Moby concerts without feeling really old.

But as for your date grouping, one useful formula I use is:
{Table.Datefield} - DayOfWeek({table.Datefield}

Always takes you back to the previous Saturday. So then add on the required number of days to get the day your week finishes. +7 if it's a Saturday, +6 if your week finishes on a Friday.

Then group by this formula. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top