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!

grouping it. 1

Status
Not open for further replies.

jhermiz2

Programmer
Dec 2, 2003
62
US
We had a contractor a long time ago come in and create this wonderful beautiful report which showed labor hours by date range. The problem is it totals all the hours for Monday, Tuesday, etc. For instance I choose Jan 1, 2004 till Feb 1, 2004 as a parameter entry. It gives me the total hours worked on monday-sunday for the employee. But I don't know why or who wanted this report cause it doesn't really help us.

I want it to display by week...so I'm thinking this would be a group by week number. I just don't know how to accomplish this in crystal reports. Right now the contractor had it group by department (engineering, purchasing, etc), then by labor code (employee, contractor, etc), then by employee last name...so im thinking right after employee last name I need another group. Group by week number. So that when I choose a time span: Jan 1, 2004-Feb 1, 2004 I get the output like so:

Engineering
Employees
Smith
Week 1 10 9 10 blah...total
Week 2 10 10 10 10 10 total
....
Stewart
Week 1
Week 2....
Purchasing......
.......

And so on and so on...
 
In Crystal 8.5, you can get week number or week of the year, using DatePart
Datepart("ww", {your.date})

You can also specify firstDayOfWeek and firstWeekOfYear, if the defaults don't suit you.

With a formula field that combined week number and year, which is Datepart("yyyy", {your.date}), you have the basis for grouping.

The [Change Group] option should let you replace the day with this new formula-field value.


Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top