on 02-27-2018 4:38 PM
Experts,
I have a Crystal Report Income statement that pulls from a SQL View. This View is pulling data from 2 DB's.
I have a Date Range parameter that applies to both DB's (CompanyA and CompanyB), but a Cost Center Parameter (Operations) that should apply only to CompanyA.
How will I go about writing this formula? What I have currently is not pulling Company B, because there is no Cost Centers created there.
{yIncomeStatementUnion.RefDate} = {?DateRange} and
{yIncomeStatementUnion.OcrName} = {?Operation}
Try
{yIncomeStatementUnion.RefDate}={?DateRange}
OR
({yIncomeStatementUnion.OcrName}={?Operation} and
{yIncomeStatementUnion.RefDate}={?DateRange}
)Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry misunderstood, not familiar with your data structure, this might work.
({yIncomeStatementUnion.OcrName}<>{?Operation} and
{yIncomeStatementUnion.RefDate}={?DateRange}
)
OR
({yIncomeStatementUnion.OcrName}={?Operation} and
{yIncomeStatementUnion.RefDate}={?DateRange}
)
Assuming you can not change view I think you will have to explicitly identify the companies
({yIncomeStatementUnion.CompanyName} = 'CompanyB' and
{yIncomeStatementUnion.RefDate}={?DateRange}
)
OR
({yIncomeStatementUnion.CompanyName} = 'CompanyA' and
{yIncomeStatementUnion.OcrName}={?Operation} and
{yIncomeStatementUnion.RefDate}={?DateRange}
)
Obviously change this to appropriate field and name or ID
Ian
Ian,
This also did not work as expected and I then changed the View to hardcode the WHERE statement in.
Thanks for your help!
Marli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.