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!

Grouping on Parameter fields

Status
Not open for further replies.

Wabush

Programmer
Jan 15, 2001
31
0
0
US
I have a report with 4 subreports. The main report has a Start Date and an End Date parameter. These get passed to a date range in the sub-reports. I would like to group on this date range in the main report..

Any suggestions?


 
Since you have a date range to filter data in the report all the records get to be in that same range, how come you want to group by that range if you only have one ? or do you mean to group in that range day by day ?.

Please be more specific and clear, we'd like to figure out so we can help you and learn something new today.

 
yes, I want to group the date range by day.

So, I would like to make an array from the Start Date parameter to the End Date so that I can group on it.

Any ideas?

 
well first of all you cannot group on an array.

What is the date format in your database? Is it possible for days to be missing from the data but you want no gaps??

I vaguely recall another post about 1-2 months ago with that problem Jim Broadbent
 
The problem is mainly that there is no date field in the main report, it is only in the subreports...
the parameter is a datetime field.
Here's the scoop;
The main report has one table with a bankid that I am passing to the subreports (total_out and total_in).

I can pass the date parameter to the subreports because they have a date field in the table they are based on but how do I show it on the main report?
 
well at least now the problem is defined...

Are you trying to merge these 4 subreports by date somehow?

that is what it seems like to me... this isn't easy...

These subreports...are they complicated? or is the info derived from a single table in each.

I guess what I am asking is perhaps it is possible to redesign the report without subreports...or perhaps one Subreport could be the basis of a main report thereby getting at the date that way. Jim Broadbent
 
Once you have the group in the main report, what do you need to do with each entry in the group? There might be a way to do what you want, using something that looks like you are grouped. But it depends on what you need to use the group for. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
not sure this is what you mean, but I need the group entry on the main report to link to the subreports by the date/time field. And I need to place the subreports in that group section.

So are you saying I can make a dummy field to group on?
 
Here is one way:

1) Create a table of numbers from 0 to 366
(or higher if your date range can be more than one year)
2) Make this table your main report.
3) Create a formula that adds this numeric field to your start Date parameter. This formula will now be a consecutive series of dates.
4) Select for the main report only records where the formula date is in your selected date range.
5) Pass this formula date to the subreports.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top