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

Date Parameter to Sub Report

Status
Not open for further replies.

Llazwas

IS-IT--Management
Feb 16, 2007
58
US
Hi -I'm using Crystal 10 with a provideX database.

I have report that pulls current order info in the main report and historical order info in a sub report. I'm trying to pass a beginning date and ending date parameter to the sub report. If I run the report for a current date range I get data in the main and sub report. If I run the report for a historical date range my main is blank (expected) and my sub is blank (not expected).

I've created a beginning and ending date parameter in both my main and sub and link the parameters together. Below are my main and sub report selection criteria.

Main:
{SO_SalesOrderHeader.SalespersonNo} = "0033" and
{SO_SalesOrderHeader.OrderDate} in {?Beginning Order Date} to {?Ending Order Date}

Sub:
{SO_SalesOrderHistoryHeader.CustomerNo} = {?Pm-AR_Customer.CustomerNo} and
{SO_SalesOrderHistoryHeader.OrderDate} in {?Beginning Order Date} to {?Ending Order Date} and
{SO_SalesOrderHistoryHeader.SalespersonNo} = {?Pm-SO_SalesOrderHeader.SalespersonNo} and
{SO_SalesOrderHistoryHeader.OrderStatus} <> "X"

Do I also need to create the CustomerNo and SalespersonNo parameters in my sub in order to get a sub with info when my main is blank?
 
I think you need to make the sub the main report and the main the sub. Subreports behave as if they are left joined to the main table, i.e., they will have data if they match the linking field in the main report; otherwise they will show no data. This means the table with the comprehensive data must be the main report table, and the table that might be missing some records needs to be the subreport table.

-LB
 
That was the trick! Thanks very much lbass!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top