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!

How to show all of items a, b and c and conditional d

Status
Not open for further replies.

KMuncy

Programmer
Sep 7, 2011
4
US
Hello,
Here is a back ground of my report:
I have a list of active Jobs. I have a field for priority and promise date. I want to see all of priority numbers 2,3,5 and if 1 = the promise date of anything up until today(in case it is late) plus 2 weeks. I have been using the formula field in the select expert but can't figure it out.

Am I going about this the wrong way? Thank you in advance for your help.

KMuncy
 
KMuncy,

To clarify:
Do you wish to see ALL jobs with a priority of 2,3,& 5 (not 4?) AND any job of priority 1 past due or due in the next 2 weeks?

OR

ALL jobs of 2,3, & 5 (not 4?) in the next two weeks AND any job of priority 1 past due or due in the next two weeks?

Please advise. Cheers!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Mike,
Thank you so much for your response.

I would like ALL jobs of 2,3,5 (not 4) and any job of priority 1 that is past due or due in the next two weeks.
 
KMuncy,

Your record selection should look something like:
Code:
{Table.Priority} in [2,3,5] OR
(
{Table.Priority} = 1 AND {Table.PromiseDate} <= DateAdd("d",14,CurrentDate)
)

In "plain English":
The Priority is either 2,3, or 5 OR The Priority is 1 AND the promise date is less than or equal to 14 days from today.

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Mike,
Thank you very much. That seems to work to a point. I have my select expert to show me only active jobs. With the priority of 1 formula, it seems to show me all jobs with priority of 1. Not just active jobs with a priority of 1. This is the entire formula I'm using:

{Job.Status} = "Active" and
{Job.Priority} in [2,3,5] or
(
{Job.Priority} = 1 and {Delivery.Promised_Date} <= dateadd("d",14,currentdate)
)

I really appreciate your help!

Thank you
KMuncy
 
KMuncy,

You did not mention any other criteria. [smile] Though I thought it seemed old, my prior reply assumed the list already contained only those tasks still active.

To Incorporate the Status criteria, implement the following bracketing: (I haven't test, but this should work)
Code:
{Job.Status} = "Active" and
(
   {Job.Priority} in [2,3,5] or
   (
      {Job.Priority} = 1 and {Delivery.Promised_Date} <= dateadd("d",14,currentdate)
   )
)

What was happening without the parenthesis is that it was seeing "Active with Priority of 2,3 or 5" OR "Priority 1 and Due prior to two weeks from now". The new parenthesis change this to read "Active" AND "either any job of Priority 2,3 or 5 OR Priority 1 due prior to two weeks from current".

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Oops! Sorry. It works! Thank you so very much. You have saved me a headache and $10 on IBProfen. Again, Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top