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!

HELP USING OR IN A FORMULA 1

Status
Not open for further replies.

Evil8

MIS
Mar 3, 2006
313
US
Greetings!

I was asked to set up a report grabbing all active employees OR spouses of a certain client 45 years old or older.

I used:
{tbl_Client.cName} = "This Company, Inc." and
IsNull({tbl_ClDependant.TermDate}) and
{@EEAge} >= 45.00 or {@DepAge} >= 45.00 and
not ({tbl_ClDependant.Descriptor} in ["BRO", "CHLD", "DAUG", "Daughter of Insured", "DECH", "DECW", "DGI", "DP", "EXSP", "FRIE", "GRAN", "NEPH", "NIEC", "SIS", "SON", "STEP", "SUB"])

This pulls up every spouse in the database 45 or older. I can run two reports, one with {@EEAge} >= 45.00 and one with {@DepAge} >= 45.00 and those work like I expected them to, but why doesn't the formula work to pick up both employee and/or spouse of the specific client company? What would be the proper formula?

Thanks for any help!
 
You have to add parens to clarify how you want your formula to be interpreted:

{tbl_Client.cName} = "This Company, Inc." and
IsNull({tbl_ClDependant.TermDate}) and
(
{@EEAge} >= 45.00 or
{@DepAge} >= 45.00
) and
not ({tbl_ClDependant.Descriptor} in ["BRO", "CHLD", "DAUG", "Daughter of Insured", "DECH", "DECW", "DGI", "DP", "EXSP", "FRIE", "GRAN", "NEPH", "NIEC", "SIS", "SON", "STEP", "SUB"])

-LB
 
Thanks a lot! I hoped it would be something simple like that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top