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!

passing date range to sub report 2

Status
Not open for further replies.
Sep 12, 2005
448
US
Hello
cr 9.0
ms sql
i have a main report that has 3 date range
{?Start_date1} {?End_Date1}
{?Start_date2} {?End_Date2}
{?Start_date2} {?End_Date3}
my record selection for them are as follow
(
{TRANSACTION_HISTORY.POSTING_DATE} in {?Start_date_1} to {?End_Date_1}
)
or
(
{TRANSACTION_HISTORY.POSTING_DATE} in {?Start_date_2} to {?End_Date_2}
)
or
(
{TRANSACTION_HISTORY.POSTING_DATE} in {?Start_date_3} to {?End_Date_3}
)

this takes to long to generate my report
can i create 3 sub report for each of the date range
{?subStart_date1} {?subEnd_Date1}
{?subStart_date2} {?subEnd_Date2}
{?subStart_date2} {?subEnd_Date3}
and link them from the main report with these


ex:
main report
{?Start_date1} {?End_Date1}
subreport link to
{?subStart_date1} {?subEnd_Date1}
any help would be appriciated

Thanks



Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
3 subreports will take longer.

You can create 3 subreports though.

Perhaps ther4e's something in the reports which is takin a long time, but the single query model will be faster providing you make sure tht it's all being passed to the database (check Database->Show SQL).

-k
 
You can build multiple date main/sub reports using the following SQL. Each page of my Crystal XI breaks on the column 'DateGroup#'

Link on the 'DateGroup#' and the @Date_From1..2..3 and the @Date_To1..2..3, etc.

--Build Date Group 1
if @Date_From1 is not null
BEGIN
insert into @tblDateRanges
select distinct
'DateGroup1',
columnfield0,
@Date_From1,
@Date_to1,
Count(columnfield1) AS CountOfcolumnfield1,
Sum(columnfield2) AS columnfield2_Amount
from table1s bs
WHERE @Date_From1 IS NOT NULL
AND (bs.date_in_Table Between @Date_From1 and @Date_To1)
GROUP BY columnfield0
END
 
hi
will try both and see what gives

Durango122
if it moves and should not used Duck Tape
if does not move and should used WD-40
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top