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

monthly report by Week

Status
Not open for further replies.

crystalbeginner15

Programmer
Sep 6, 2005
76
US
I am using CR 11 and a i am trying to create a monthly report

The report looks something like this

Day Sunday Monday Tues Wed Thur Fri Dir north south North South
1
2
3
.
.
.
24
for 24 hours each day
I will have a six page report one for each week .If first of the month starts on Tuesday I will put zeros for sun and mon . How should I check that the date falls in first week or second week and so on. Please suggest any approach of achieving this.
 
DatePart('ww', {your_date_field}, firstDayOfWeek, firstWeekOfYear)

hth,
- Ido



Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
If you group on Ido's formula, and then set "new page after" on the group footer, each week will be on it's own page.

-LB
 
The record selection formula would restrict the records to only those from the selected month. Then, the formula I suggested would allow you to group on week within that month.

If you don't need a formula that returns the week number (min & max of that formula would tell you if you are on the first or last week within that month), then there are simpler ways:

Restrict the records to the month.

Group on {your_date} but select the for each week option in the Group dialog.

Insert in the Group footer or header a Crosstab (row = hour, column = {your_date} with option to group on each day.

Insert another crosstab (side by side with the 1st one to provide the (Dir north south North South) info.

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
You can have several nested groups from the same date: week and month and year too. Does this help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top