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

2 tasks one formula

Status
Not open for further replies.

giggles7840

IS-IT--Management
Mar 8, 2002
219
US
hopefully this will make sense and can be done. here aare the 2 statements that i have:

Statement 1 - This one will restrict certain records.
if {@Appraisal Area} = "Appraisal" then {LsaAcct.LsaStatusCd} IN ['Active','On Hold']else
if {@Credit Area} = "Credit" then {LscAcct.LscStatusCd} IN ['Active','On Hold']else
If {@Flood Area} = "Flood" then {LsfAcct.LsfStatusCd} IN ['Active','On Hold']

Statement 2 - This one is what i use for a parameter.
if {@Appraisal Area} = "Appraisal" then "Appraisal"else
if {@Credit Area} = "Credit" then "Credit" else
If {@Flood Area} = "Flood" then "Flood"

is there a ways to wrap these together in one formula?
 
I've tried to help here, but you didn't state requirements, just a couple of formulas without stating why they're used or where.

Rewritten:
Statement 1 - This one will restrict certain records.
if {@Appraisal Area} = "Appraisal"
or
{@Credit Area} = "Credit"
or
{@Flood Area} = "Flood" then
{LsaAcct.LsaStatusCd} IN ['Active','On Hold']else

Statement 2 - This one is what i use for a parameter.

This can't be used as a parameter, perhaps you mean that you use this to pass filtering criteria to the database? I can't see how, it doesn't reference any database fields.

if {@Appraisal Area} = "Appraisal" then "Appraisal" else
if {@Credit Area} = "Credit" then "Credit" else
If {@Flood Area} = "Flood" then "Flood"

And why would theses formulas be combined, they aren't related.

Where are these intended to be used?

If you're trying to limit data coming from the database, then use the Report->Edit Selection Formula->Record and try something like:

(
if {@Appraisal Area} = "Appraisal"
or
{@Credit Area} = "Credit"
or
{@Flood Area} = "Flood" then
{LsaAcct.LsaStatusCd} IN ['Active','On Hold']
)

and if you're trying to limit some other field to only those that contain the terms Appraisal, Credit or Flood, then add to the above:

and
(
{table.field} in ["Appraisal", Credit", "Flood"]
)

Since you don't bother to show what's in @Appraisal Area, etc. it's hard to tell your intent.

Try explainging requirements, not what you've tried that isn't working as desired, it isn't very helpful.

Also please post technical information, such as:

Crystal version
Database used
Example data
Expected output

-k
 
sorry im extremely tired. let me try again.

statement 1:
if {@Appraisal Area} = "Appraisal" then {LsaAcct.LsaStatusCd} IN ['Active','On Hold']else
if {@Credit Area} = "Credit" then {LscAcct.LscStatusCd} IN ['Active','On Hold']else
If {@Flood Area} = "Flood" then {LsfAcct.LsfStatusCd} IN ['Active','On Hold']

this statement uses 3 different tables. i have a parameter that allows the user to pick Appraisal, Credit, or Flood. The value they pick should activate the appropriate line of code in statement 1. Statement 2 is the values for the parameter that they will be using.

when i add statement 1 to the record selection formula it does not work correctly. so i thought there might be a way to wrap them both into one formula unless there is a better way that i am not seeing since i am oh so sleepy! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top