Hi all, I am having trouble getting the correct data picked up by my subreport. Here is an example of what my report should look like:
Main:
Sub Category - Cash
Acct 1
Tkt A 20 $50
Tkt B 10 $4
Tkt C 30 $45
Acct 2
Tkt A 5 $10
Tkt C 2 $20
SubReport:
Sub Category - Cash
Tkt A 25 $60
Tkt B 10 $4
Tkt C 32 $65
There are several parameters the user can enter to limit the data. In my Subreport I have tried the following Record Selection formula:
{VENDOR_SALES.ORDER_DATE} >= {?Pm-@From Date} and
{VENDOR_SALES.ORDER_DATE} <= {?Pm-@To Date} and
{VENDOR_SALES.UNIT_SOLD} > 0.00 and
{VENDOR_ACCOUNT.SUFFIX} = 0.00 and
{VENDOR_ACCOUNT.SUB_CATEGORY} = {?Pm-VENDOR_ACCOUNT.SUB_CATEGORY}
This works correctly when the parms are left to the default for all records.
The problem is when I try to include the other optional parms. I can only get it to work for one or the other scenario. For example if the user only wants to see Acct 1, the Subreport should only show Acct 1 info. Also, I have 2 other optional parms that need to be included too.
I have tried:
({VENDOR_SALES.ORDER_DATE} >= {?Pm-@From Date} and
{VENDOR_SALES.ORDER_DATE} <= {?Pm-@To Date} and
{VENDOR_SALES.UNIT_SOLD} > 0.00 and
{VENDOR_ACCOUNT.SUFFIX} = 0.00 and
{VENDOR_ACCOUNT.SUB_CATEGORY} = {?Pm-VENDOR_ACCOUNT.SUB_CATEGORY})
or
({VENDOR_SALES.ORDER_DATE} >= {?Pm-@From Date} and
{VENDOR_SALES.ORDER_DATE} <= {?Pm-@To Date} and
{VENDOR_SALES.UNIT_SOLD} > 0.00 and
{VENDOR_ACCOUNT.SUFFIX} = 0.00 and
{VENDOR_ACCOUNT.SUB_CATEGORY} = {?Pm-VENDOR_ACCOUNT.SUB_CATEGORY} and
{VENDOR_ACCOUNT.ACCT_ID} = {?Pm-VENDOR_ACCOUNT.ACCT_ID})
This one works correctly when the parms are left to default for all records but it does not limit the data in the subreport when I only want a specific acct. If I use just the second part of the formula (the section after the OR), it works correctly for a specific acct but not for all records.
I have tried reversing the order to no avail.
So I need a way to combine all the possible scenarios in one record selection. I also tried just using the Subreport Link section but that by itself did not give me what I want either.
Hopefully this makes sense and somebody can offer a suggestion.