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

How does this formula evaluate?

Status
Not open for further replies.

azoe

Technical User
Feb 21, 2005
175
US
Crystal 11, MS SQL database connecting to stored procedure with ODBC.

I calculate a figure based on whether it comes from a certain department and whether it is in a certain group of employees. So I made a formula to determine the certain departments like this:

(The {@RenderingDepartments} formula is:
If {dch_MonthlyPmtsWithSIMandDept;1.department} = 'Miscellaneous'
Then 'yes'
Else 'no')

And a similar one for employees.

Now can I use this to evaluate if both are true?
{@RenderingDepartments} = 'Yes'
and {@OurEmployeeThenYes} = 'Yes'

What I'm wondering is what a formula like the one directly above evaluates to ('Yes'? or True? Is it True if they are both True and False if some are Yes and some are No?) What if one of them is No?

Should I be using = 1 instead of Yes and then using a formula that says if = 2 then it is true?

Thank you


 
You can use:

if {@RenderingDepartments} = 'Yes'
and {@OurEmployeeThenYes} = 'Yes' then 1 else 0

Then right click on this formula and insert a summary (SUM, not count).

-LB
 
Ok, or for the purposes of record selection it looks like I could change the {@RenderingDepartments} formula to:

{dch_MonthlyPmtsWithSIMandDept;1.department} = 'Miscellaneous'

and then that will evaluate to True or False ...

If I use multiple departments in the formula and connect them with AND and they are all True then will the final result be True and if some are True and some are false the final result would be False? Is that right?



Thanks -
 
Instead of asking questions about how formulas are evaluated, I think you would get better answers if you explained what you wanted to do. I originally thought you were trying to count records that met certain criteria. It now looks like you might be trying to limit the report to records that meet these criteria. Then you would use a record selection formula of:

{dch_MonthlyPmtsWithSIMandDept;1.department} = 'Miscellaneous' and
{youremployeefield} = 'Your criterion'

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top