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

Group report in every four weeks...

Status
Not open for further replies.

skrobbert

Technical User
Jun 7, 2001
29
0
0
NL
Hi can anybody help me to group my report? I can group it into every week, 2 weeks and month but not in every 4 weeks.
I use Crystal Reports 9.
Thanks in advance,

Robbert van Spronsen
 
A simple approach would be hardcoding using specified order 4 weeks apart

I have tried a dateadd but cannot get it to work yet
 
In Crystal 8.5, you could use
DateAdd("d", -28, {your.date})
Create this as a formula field, and then subtract another 28 days to get the previous set etc.

Madawc Williams
East Anglia
Great Britain
 
I don't know what your start date is so I'll assume Monday 31st Dec 2001, Create a formula:

{@4WeekPeriodCalc}
DateVar StartDate := Date(2001,12,31);
DateVar EndDate := StartDate + 28;
NumberVar Period := 1;

While Not(Date(&quot;31/10/2002&quot;) >= StartDate and Date(&quot;31/10/2002&quot;) <= EndDate) do
(
Startdate := StartDate +29;
EndDate := EndDate + 28;
Period := Period + 1
);
Period;

Replace the items in italics with your date field and the item in bold with your start date.

This will give each record a 4 week period number. You can then group by this field.










Reebo
Scotland (Sunny with a Smile)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top