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

Multi-condition finds

Status
Not open for further replies.

MarkDraa

MIS
Aug 10, 2001
22
0
0
US
I've got a bear-of-a-find I need to code into a macro. I'd like to define a stored find with the assistant rather than use the form fields, since I'll be on a menu-type view and don't want to clutter the view with hidden fields.

I have two variable fields, VarEE (selected by the user with a drop-down list) & VarDate (input by the user), In the database, each record contains an "EE" field, a "Status" field and multiple "Due Date" fields. I want the find to identify records for the selected employee and specific status code, where ANY of the Due Date fields are less than or equal to the VarDate entered.

My find needs to do this:

IF (VarEE = EE AND Status < 3) AND
((DueDate1 <= VarDate) OR
(DueDate2 <= VarDate) OR
(DueDate3 <= VarDate) OR
(DueDate4 <= VarDate))

I can't seem to get the assistant to accept the variable fields as the matching component, and I don't see any way to select priority of the entered conditions (equivalent to the parentheses above).

How is this task best accomplished?

TIA!

Mark
 
This is easy. Define a calculated field named IsMatch and put your formula in it like this:

IsMatch = IF ((VarEE = EE AND Status < 3) AND
((DueDate1 <= VarDate) OR
(DueDate2 <= VarDate) OR
(DueDate3 <= VarDate) OR
(DueDate4 <= VarDate)),1,0)

Now in the Find Assistant you only need to see if IsMatch = 1 !

Sue Sloan
XpertSS.com
 
Well Hello, Sue! Remember me?

Your solution is elegant, of course. I was stuck on the &quot;find&quot; merry-go-round and couldn't see the forest for the trees (I think that was one too many analogies for one sentence...).

Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top